Go to the documentation of this file.
27 #ifndef ASYNC_TCP_SERVER_BASE_INCLUDED
28 #define ASYNC_TCP_SERVER_BASE_INCLUDED
39 #include <sigc++/sigc++.h>
112 class TcpServerBase :
public sigc::trackable
147 int writeAll(
const void *buf,
int count);
169 uint16_t remote_port) = 0;
174 typedef std::vector<TcpConnection*> TcpConnectionList;
178 TcpConnectionList tcpConnectionList;
181 void onConnection(
FdWatch *watch);
int writeAll(const void *buf, int count)
Write data to all connected clients.
void addConnection(TcpConnection *con)
Contains a class for handling exiting TCP connections.
A class for handling exiting TCP connections.
int numberOfClients(void)
Get the number of clients that is connected to the server.
virtual void createConnection(int sock, const IpAddress &remote_addr, uint16_t remote_port)=0
TcpServerBase(const std::string &port_str, const Async::IpAddress &bind_ip)
Default constuctor.
int writeOnly(TcpConnection *con, const void *buf, int count)
Send data only to the given client.
int writeExcept(TcpConnection *con, const void *buf, int count)
Send data to all connected clients except the given client.
Namespace for the asynchronous programming classes.
TcpConnection * getClient(unsigned int index)
Get the client object pointer from the server.
virtual ~TcpServerBase(void)
Destructor.
A class for representing an IP address in an OS independent way.
void removeConnection(TcpConnection *con)
A class for watching file descriptors.