TCP Server Class that allows to create a server to interact with send and receive operations.
#include <tcpServer.h>
|
void | startAccept () |
| The begging of the accept.
|
|
| TcpAsyncServer (boost::asio::io_context &io_context, std::string ip, unsigned short port) |
| TCP Asynchronous server constructor. More...
|
|
virtual | ~TcpAsyncServer () |
| TCP Asynchronous server destructor.
|
|
void | close (boost::system::error_code &rEc) |
| Close the Asynchronous TCP server. More...
|
|
void | stopAll () |
| Close all connections.
|
|
void | publishMsg (const std::string &message) |
| Publish a message to all clients. More...
|
|
void | setWriteStatusHandler (boost::function< void(const boost::system::error_code &error, std::size_t size)> writeStatusHandler) |
| Bridge to write connection function. More...
|
|
void | setReceiveSendHandler (boost::function< void(const boost::system::error_code &error, const char *receiveData, std::string &sendData)> receiveSendHandler) |
| Bridge to write connection function. More...
|
|
TcpAsyncServer |
( |
boost::asio::io_context & |
io_context, |
|
|
std::string |
ip, |
|
|
unsigned short |
port |
|
) |
| |
- Parameters
-
io_context | IO Context |
ip | The destination IP. |
port | Which port. |
void close |
( |
boost::system::error_code & |
rEc | ) |
|
void publishMsg |
( |
const std::string & |
message | ) |
|
- Parameters
-
message | Message to be sent |
void setReceiveSendHandler |
( |
boost::function< void(const boost::system::error_code &error, const char *receiveData, std::string &sendData)> |
receiveSendHandler | ) |
|
- Parameters
-
receiveSendHandler | The read handler to send data. |
void setWriteStatusHandler |
( |
boost::function< void(const boost::system::error_code &error, std::size_t size)> |
writeStatusHandler | ) |
|
- Parameters
-
writeStatusHandler | The write handler to call when finish. |