netLink C++ 11
|
Socket with MsgPack abstraction layer. More...
#include <MsgPackSocket.h>
Public Member Functions | |
MsgPackSocket & | operator<< (std::unique_ptr< MsgPack::Element > element) |
Public Member Functions inherited from netLink::Socket | |
void | initAsTcpClient (const std::string &hostRemote, unsigned portRemote, bool waitUntilConnected=false) |
void | initAsTcpServer (const std::string &hostLocal, unsigned portLocal, unsigned listenQueue=16) |
void | initAsUdpPeer (const std::string &hostLocal, unsigned portLocal) |
IPVersion | getIPVersion () const |
Returns the IPVersion of the socket. | |
Type | getType () const |
Returns the SocketType of the socket. | |
Status | getStatus () const |
Returns the SocketStatus of the socket. | |
std::streamsize | showmanyc () |
std::streamsize | receive (char_type *buffer, std::streamsize size) |
std::streamsize | send (const char_type *buffer, std::streamsize size) |
std::streamsize | redirect (const std::vector< std::shared_ptr< Socket > > &destinations) |
std::streamsize | getInputBufferSize () |
Get the size of the input intermediate buffer in bytes. | |
std::streamsize | getOutputBufferSize () |
Get the size of the output intermediate buffer in bytes. | |
void | setInputBufferSize (std::streamsize size) |
Set the size of the input intermediate buffer in bytes (unread contents are lost) | |
void | setOutputBufferSize (std::streamsize size) |
Set the size of the output intermediate buffer in bytes (unwritten contents are lost) | |
void | setBlockingMode (bool blocking) |
void | setBroadcast (bool active) |
void | setMulticastGroup (const std::string &address, bool join) |
std::shared_ptr< Socket > | accept () |
void | disconnect () |
Disconnects the socket, deletes the intermediate buffers and sets the handle to -1. | |
void | disconnectOnError () |
Check if there is a problem with this socket and disconnect in case there is one. | |
Public Attributes | |
std::queue< std::unique_ptr< MsgPack::Element > > | queue |
Internal queue of elements to be serialized and sent. | |
MsgPack::Serializer | serializer |
Internal MsgPack serializer. | |
MsgPack::Deserializer | deserializer |
Internal MsgPack deserializer. | |
Public Attributes inherited from netLink::Socket | |
std::set< std::shared_ptr< Socket > > | clients |
Client sockets of a server. | |
std::string | hostLocal |
Host string of local. | |
std::string | hostRemote |
Host string of remote. | |
unsigned int | portLocal |
Port of local. | |
unsigned int | portRemote |
Port of remote. | |
Protected Member Functions | |
std::shared_ptr< Socket > | SocketFactory () |
Generates new sockets for client connections of a server. | |
Protected Member Functions inherited from netLink::Socket | |
void | initSocket (bool blocking) |
virtual std::shared_ptr< Socket > | SocketFactory () |
Generates new sockets for client connections of a server. | |
Friends | |
class | SocketManager |
Additional Inherited Members | |
Public Types inherited from netLink::Socket | |
enum | IPVersion { IPv4 , IPv6 , ANY } |
Defines the version of IP. More... | |
enum | Type { NONE , TCP_CLIENT , TCP_SERVER , TCP_SERVERS_CLIENT , UDP_PEER } |
Defines the nature of a socket. More... | |
enum | Status { NOT_CONNECTED , CONNECTING , LISTENING , READY , BUSY } |
Defines the send status of a socket. More... | |
Protected Attributes inherited from netLink::Socket | |
IPVersion | ipVersion |
IP version which is in use. | |
Type | type |
Type of the socket. | |
unsigned int | status |
Or listen queue size if socket is TCP_SERVER. | |
int | handle |
Handle used for the system interface. | |
Socket with MsgPack abstraction layer.
|
inline |
Pushes one MsgPack::Element in the queue.
element | pointer containing the element |
|
inlineprotectedvirtual |
Generates new sockets for client connections of a server.
Reimplemented from netLink::Socket.