The base class for creating a TCP server.
More...
#include <AsyncTcpServerBase.h>
The base class for creating a TCP server.
- Author
- Tobias Blomberg
- Date
- 2003-12-07
Definition at line 112 of file AsyncTcpServerBase.h.
◆ TcpServerBase()
Async::TcpServerBase::TcpServerBase |
( |
const std::string & |
port_str, |
|
|
const Async::IpAddress & |
bind_ip |
|
) |
| |
Default constuctor.
- Parameters
-
port_str | A port number or service name to listen to |
bind_ip | The IP to bind the server to |
◆ ~TcpServerBase()
virtual Async::TcpServerBase::~TcpServerBase |
( |
void |
| ) |
|
|
virtual |
◆ addConnection()
◆ createConnection()
virtual void Async::TcpServerBase::createConnection |
( |
int |
sock, |
|
|
const IpAddress & |
remote_addr, |
|
|
uint16_t |
remote_port |
|
) |
| |
|
protectedpure virtual |
◆ getClient()
TcpConnection* Async::TcpServerBase::getClient |
( |
unsigned int |
index | ) |
|
◆ numberOfClients()
int Async::TcpServerBase::numberOfClients |
( |
void |
| ) |
|
Get the number of clients that is connected to the server.
- Returns
- The number of connected clients
◆ removeConnection()
void Async::TcpServerBase::removeConnection |
( |
TcpConnection * |
con | ) |
|
|
protected |
◆ writeAll()
int Async::TcpServerBase::writeAll |
( |
const void * |
buf, |
|
|
int |
count |
|
) |
| |
Write data to all connected clients.
- Parameters
-
buf | The data buffer |
count | The number of bytes in the data buffer |
- Returns
- The number of bytes sent
◆ writeExcept()
int Async::TcpServerBase::writeExcept |
( |
TcpConnection * |
con, |
|
|
const void * |
buf, |
|
|
int |
count |
|
) |
| |
Send data to all connected clients except the given client.
- Parameters
-
con | The TcpConnection object not to send to |
buf | The data buffer |
count | The number of bytes in the data buffer |
- Returns
- The number of bytes sent
◆ writeOnly()
int Async::TcpServerBase::writeOnly |
( |
TcpConnection * |
con, |
|
|
const void * |
buf, |
|
|
int |
count |
|
) |
| |
Send data only to the given client.
- Parameters
-
con | The TcpConnection object to send to |
buf | The data buffer |
count | The number of bytes in data buffer |
- Returns
- The number of bytes sent
The documentation for this class was generated from the following file: