netLink C++ 11
|
Manages a group of Sockets. More...
#include <netLink.h>
Public Member Functions | |
std::shared_ptr< Socket > | newSocket () |
Allocates a new Socket, inserts it into sockets and returns it. | |
std::shared_ptr< Socket > | newMsgPackSocket () |
Allocates a new MsgPackSocket, inserts it into sockets and returns it. | |
void | listen (double waitUpToSeconds=0.0) |
Public Attributes | |
std::function< bool(SocketManager *manager, std::shared_ptr< Socket > serverSocket, std::shared_ptr< Socket > clientSocket)> | onConnectRequest |
Event which is called if a TCP_SERVER accepts a new connection (if false is returned the connection will be closed immediately) | |
std::function< void(SocketManager *manager, std::shared_ptr< Socket > socket, Socket::Status prev)> | onStatusChange |
Event which is called if a socket can or can not send more data (also called if nonblocking connect succeeded) | |
std::function< void(SocketManager *manager, std::shared_ptr< Socket > socket)> | onReceiveRaw |
Event which is called if a socket receives new raw data. | |
std::function< void(SocketManager *manager, std::shared_ptr< Socket > socket, std::unique_ptr< MsgPack::Element > element)> | onReceiveMsgPack |
Event which is called if a socket receives a MsgPack::Element. | |
std::set< std::shared_ptr< Socket > > | sockets |
Sockets which are managed. | |
Manages a group of Sockets.
void netLink::SocketManager::listen | ( | double | waitUpToSeconds = 0.0 | ) |
Listens a periode time
waitUpToSeconds | Maximum time to wait for incoming data in seconds or negative values to wait indefinitely |