10 #ifndef YARP_UNIX_UNIXSOCKETCARRIER_H
11 #define YARP_UNIX_UNIXSOCKETCARRIER_H
40 std::string
getName()
const override;
65 static constexpr
const char* name =
"unix_stream";
66 static constexpr
int specifierCode = 11;
67 static constexpr
const char* headerCode =
"UNIX_STR";
69 static constexpr
const char* name_ack =
"unix_stream_ack";
70 static constexpr
int specifierCode_ack = 12;
71 static constexpr
const char* headerCode_ack =
"UNIX_ACK";
73 static constexpr
size_t headerSize = 8;
75 static constexpr
const char* ack_string =
"ACK";
76 static constexpr
size_t ack_string_size = 4;
78 std::string socketPath;
79 bool requireAckFlag{
false};
A stream abstraction for unix socket communication.
Communicating between two ports(IPC) via Unix Socket.
bool sendAck(yarp::os::ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
bool sendIndex(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
UnixSocketCarrier & operator=(UnixSocketCarrier &&)=delete
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool expectAck(yarp::os::ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
UnixSocketCarrier(const UnixSocketCarrier &)=delete
~UnixSocketCarrier() override=default
bool configure(yarp::os::ConnectionState &proto) override
Give carrier a shot at looking at how the connection is set up.
UnixSocketCarrier()=default
bool expectIndex(yarp::os::ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
UnixSocketCarrier & operator=(const UnixSocketCarrier &)=delete
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
UnixSocketCarrier(UnixSocketCarrier &&)=delete
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
bool configureFromProperty(yarp::os::Property &options) override
yarp::os::Carrier * create() const override
Factory method.
void getHeader(yarp::os::Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
bool checkHeader(const yarp::os::Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
A starter class for implementing simple carriers.
A simple abstraction for a block of bytes.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
The basic state of a connection - route, streams in use, etc.
A class for storing options and configuration information.
Minimal requirements for an efficient Writer.