|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
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};
85 #endif // YARP_UNIX_UNIXSOCKETCARRIER_H
Communicating between two ports(IPC) via Unix Socket.
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 expectAck(yarp::os::ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
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...
bool expectIndex(yarp::os::ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
yarp::os::Carrier * create() const override
Factory method.
bool configure(yarp::os::ConnectionState &proto) override
Give carrier a shot at looking at how the connection is set up.
~UnixSocketCarrier() override=default
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
A starter class for implementing simple carriers.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
UnixSocketCarrier & operator=(const UnixSocketCarrier &)=delete
UnixSocketCarrier(UnixSocketCarrier &&)=delete
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
UnixSocketCarrier(const UnixSocketCarrier &)=delete
A simple abstraction for a block of bytes.
The basic state of a connection - route, streams in use, etc.
bool sendAck(yarp::os::ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
UnixSocketCarrier()=default
UnixSocketCarrier & operator=(UnixSocketCarrier &&)=delete
bool sendIndex(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
A stream abstraction for unix socket communication.
bool configureFromProperty(yarp::os::Property &options) override
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
Minimal requirements for an efficient Writer.
A class for storing options and configuration information.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)