![]() |
Flair
Framework Libre Air
|
Class encapsulating a TCP socket. More...
#include <TcpSocket.h>
Inheritance diagram for flair::core::TcpSocket:Public Member Functions | |
| TcpSocket (const Object *parent, const std::string name, bool blockOnSend=false, bool blockOnReceive=true) | |
| void | Listen (const unsigned int port, const std::string localAddress="ANY") |
| Returns a socket which listens on a specific port/address. More... | |
| TcpSocket * | Accept (Time timeout=TIME_INFINITE) |
| Returns a socket on a new incoming connexion. More... | |
| bool | Connect (const unsigned int distantPort, const std::string distantAddress, Time timeout=TIME_INFINITE) |
| Returns a socket connected to a distant host. More... | |
| ssize_t | SendMessage (const char *message, size_t message_len, Time timeout=TIME_INFINITE) |
| Send a message waiting up to timeout ns. More... | |
| ssize_t | RecvMessage (char *buf, size_t buf_len, Time timeout=TIME_INFINITE) |
| Receive a message. More... | |
| uint16_t | NetworkToHost16 (uint16_t data) |
| ! See Socket.h for a more generic implementation of network/host endianness More... | |
| uint16_t | HostToNetwork16 (uint16_t data) |
| uint32_t | NetworkToHost32 (uint32_t data) |
| uint32_t | HostToNetwork32 (uint32_t data) |
Public Member Functions inherited from flair::core::ConnectedSocket | |
| ConnectedSocket (const Object *parent, const std::string name) | |
| Constructor. More... | |
| ~ConnectedSocket () | |
| Destructor. More... | |
| std::string | ReadString (const size_t &stringLength, Time timeout) |
| uint16_t | ReadUInt16 (Time const &timeout) |
| void | WriteUInt16 (uint16_t const &data, Time const &timeout) |
| uint32_t | ReadUInt32 (Time const &timeout) |
| void | WriteUInt32 (uint32_t const &data, Time const &timeout) |
Public Member Functions inherited from flair::core::Object | |
| Object (const Object *parent=NULL, std::string name="", std::string type="") | |
| Constructor. More... | |
| virtual | ~Object () |
| Destructor. More... | |
| std::string | ObjectName (void) const |
| Name. More... | |
| std::string | ObjectType (void) const |
| Type. More... | |
| const Object * | Parent (void) const |
| Parent. More... | |
| std::vector< const Object * > * | TypeChilds (void) const |
| Childs of the same type. More... | |
| std::vector< const Object * > * | Childs (void) const |
| Childs. More... | |
| void | Information (const char *function, int line, const char *format,...) const |
| Formatted information. More... | |
| void | Warning (const char *function, const char *format,...) const |
| Formatted warning. More... | |
| void | Error (const char *function, const char *format,...) const |
| Formatted error. More... | |
| bool | ErrorOccured (bool recursive=true) const |
| Has an errror occured? More... | |
Additional Inherited Members | |
Public Types inherited from flair::core::Object | |
| enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Class encapsulating a TCP socket.
|
virtual |
Returns a socket which listens on a specific port/address.
| const | Object* parentObject |
| const | string name |
| unsigned | int port |
| const | localAddress (defaults to any) |
Implements flair::core::ConnectedSocket.
Returns a socket on a new incoming connexion.
| timeout | timeout (in nanoseconds) |
Implements flair::core::ConnectedSocket.
|
virtual |
Returns a socket connected to a distant host.
| const | Object* parentObject |
| const | string name |
| unsigned | int port |
| const | distantAddress |
| timeout | timeout (in nanoseconds) |
Implements flair::core::ConnectedSocket.
|
virtual |
Send a message waiting up to timeout ns.
| message | message |
| message_len | message length |
| timeout | timeout (in nanoseconds) |
Implements flair::core::ConnectedSocket.
|
virtual |
Receive a message.
Receive a message and wait up to timeout ns.
| buf | buffer to put the message |
| buf_len | buffer length |
| timeout | timeout (in nanoseconds) |
Implements flair::core::ConnectedSocket.
|
virtual |
! See Socket.h for a more generic implementation of network/host endianness
Implements flair::core::ConnectedSocket.