 |
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
9 #ifndef YARP_UNIX_UNIXSOCKTWOWAYSTREAM_H
10 #define YARP_UNIX_UNIXSOCKTWOWAYSTREAM_H
42 void close()
override;
50 bool isOk()
const override;
52 void reset()
override;
57 bool open(
bool sender =
false);
63 bool openedAsReader{
false};
68 std::string socketPath;
72 static constexpr
size_t maxAttempts = 5;
73 static constexpr
double delayBetweenAttempts = 0.1;
76 #endif // YARP_UNIX_UNIXSOCKTWOWAYSTREAM_H
A stream which can be asked to perform bidirectional communication.
~UnixSockTwoWayStream() override
virtual void write(char ch)
Write a single byte to the stream.
Simple specification of the minimum functions needed from output streams.
void setLocalAddress(yarp::os::Contact &_localAddress)
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
void setRemoteAddress(yarp::os::Contact &_remoteAddress)
UnixSockTwoWayStream(const std::string &_socketPath="")
A simple abstraction for a block of bytes.
bool open(bool sender=false)
void beginPacket() override
Mark the beginning of a logical packet.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
void reset() override
Reset the stream.
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
void interrupt() override
Interrupt the stream.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
A stream abstraction for unix socket communication.
bool isOk() const override
Check if the stream is ok or in an error state.
InputStream & getInputStream() override
Get an InputStream to read from.
void close() override
Terminate the stream.