6#ifndef YARP_UNIX_UNIXSOCKTWOWAYSTREAM_H
7#define YARP_UNIX_UNIXSOCKTWOWAYSTREAM_H
39 void close()
override;
47 bool isOk()
const override;
49 void reset()
override;
54 bool open(
bool sender =
false);
60 bool openedAsReader{
false};
65 std::string socketPath;
69 static constexpr size_t maxAttempts = 5;
70 static constexpr double delayBetweenAttempts = 0.1;
A stream abstraction for unix socket communication.
bool isOk() const override
Check if the stream is ok or in an error state.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
InputStream & getInputStream() override
Get an InputStream to read from.
void beginPacket() override
Mark the beginning of a logical packet.
void interrupt() override
Interrupt the stream.
bool open(bool sender=false)
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void reset() override
Reset the stream.
~UnixSockTwoWayStream() override
void close() override
Terminate the stream.
void setLocalAddress(yarp::os::Contact &_localAddress)
void endPacket() override
Mark the end of a logical packet (see beginPacket).
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
void setRemoteAddress(yarp::os::Contact &_remoteAddress)
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
A simple abstraction for a block of bytes.
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
A stream which can be asked to perform bidirectional communication.