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 ) |
◆ ~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 | | ) |
|
◆ 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
- Examples
- AsyncTcpServer_demo.cpp.
◆ 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
- Examples
- AsyncTcpServer_demo.cpp.
◆ 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
- Examples
- AsyncTcpServer_demo.cpp.
The documentation for this class was generated from the following file: