28 bool blockOnSend =
false,
bool blockOnReceive =
true);
30 void Listen(
const unsigned int port,
const std::string localAddress =
"ANY");
32 Time timeout = TIME_INFINITE);
33 bool Connect(
const unsigned int distantPort,
const std::string distantAddress,
34 Time timeout = TIME_INFINITE);
35 ssize_t
SendMessage(
const char *message,
size_t message_len,
Time timeout = TIME_INFINITE);
36 ssize_t
RecvMessage(
char *buf,
size_t buf_len,
Time timeout = TIME_INFINITE);
39 uint16_t HostToNetwork16(uint16_t data);
40 uint32_t NetworkToHost32(uint32_t data);
41 uint32_t HostToNetwork32(uint32_t data);
49 unsigned int distantPort;
50 std::string distantAddress;
51 char *sendRingBuffer, *recvRingBuffer;
Interface class encapsulating a connected socket. Preserves packets order and guaranty delivery...
Definition: ConnectedSocket.h:27
Base class for all Framework's classes.
Definition: Object.h:83
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:55
Class encapsulating a TCP socket.
Definition: TcpSocket.h:25
Class defining a socket working in connected mode.
void Listen(const unsigned int port, const std::string localAddress="ANY")
Returns a socket which listens on a specific port/address.
uint16_t NetworkToHost16(uint16_t data)
! See Socket.h for a more generic implementation of network/host endianness
ssize_t RecvMessage(char *buf, size_t buf_len, Time timeout=TIME_INFINITE)
Receive a message.
bool Connect(const unsigned int distantPort, const std::string distantAddress, Time timeout=TIME_INFINITE)
Returns a socket connected to a distant host.
TcpSocket * Accept(Time timeout=TIME_INFINITE)
Returns a socket on a new incoming connexion.
ssize_t SendMessage(const char *message, size_t message_len, Time timeout=TIME_INFINITE)
Send a message waiting up to timeout ns.