34 #ifndef ASYNC_TCP_SERVER_INCLUDED 35 #define ASYNC_TCP_SERVER_INCLUDED 46 #include <sigc++/sigc++.h> 160 int writeAll(
const void *buf,
int count);
191 sigc::signal<void, TcpConnection *,TcpConnection::DisconnectReason>
198 typedef std::vector<TcpConnection*> TcpConnectionList;
202 TcpConnectionList tcpConnectionList;
205 void onConnection(
FdWatch *watch);
A class for handling exiting TCP connections.
int writeAll(const void *buf, int count)
Write data to all connected clients.
int writeExcept(TcpConnection *con, const void *buf, int count)
Send data to all connected clients except the given client.
sigc::signal< void, TcpConnection * > clientConnected
A signal that is emitted when a client connect to the server.
A class for creating a TCP server.
~TcpServer(void)
Destructor.
A class for watching file descriptors.
TcpConnection * getClient(unsigned int index)
Get the client object pointer from the server.
Contains a class for handling exiting TCP connections.
int writeOnly(TcpConnection *con, const void *buf, int count)
Send data only to the given client.
DisconnectReason
Reason code for disconnects.
int numberOfClients(void)
Get the number of clients that is connected to the server.
Namespace for the asynchronous programming classes.
TcpServer(const std::string &port_str, const Async::IpAddress &bind_ip=IpAddress())
Default constuctor.
A class for representing an IP address in an OS independent way.
sigc::signal< void, TcpConnection *, TcpConnection::DisconnectReason > clientDisconnected
A signal that is emitted when a client disconnect from the server.