tcpServer.h
Go to the documentation of this file.
29 boost::function<void(const boost::system::error_code& error, const char* receiveData, std::string& sendData)> mReceiveSendHandler;
30 boost::function<void(const boost::system::error_code& error, std::size_t size)> mWriteStatusHandler;
102 void setWriteStatusHandler(boost::function<void(const boost::system::error_code& error, std::size_t size)> writeStatusHandler);
107 void setReceiveSendHandler(boost::function<void(const boost::system::error_code& error, const char* receiveData, std::string& sendData)> receiveSendHandler);
123 boost::function<void(const boost::system::error_code& error, const char* receiveData, std::string& sendData)> mReceiveSendHandler;
124 boost::function<void(const boost::system::error_code& error, std::size_t size)> mWriteStatusHandler;
132 void handleAccept(const boost::system::error_code& error, boost::shared_ptr<TcpConnection> new_connection);
180 void setWriteStatusHandler(boost::function<void(const boost::system::error_code& error, std::size_t size)> writeStatusHandler);
185 void setReceiveSendHandler(boost::function<void(const boost::system::error_code& error, const char* receiveData, std::string& sendData)> receiveSendHandler);
void setWriteStatusHandler(boost::function< void(const boost::system::error_code &error, std::size_t size)> writeStatusHandler)
Bridge to write connection function.
void setReceiveSendHandler(boost::function< void(const boost::system::error_code &error, const char *receiveData, std::string &sendData)> receiveSendHandler)
Bridge to write connection function.
TCP Server Class that allows to create a server to interact with send and receive operations.
Definition: tcpServer.h:116
static pointer create(BOOST_IO_CONTEXT &io_context)
Static function to create the boost share object of Connection related to an io context....
Definition: tcpServer.h:67
TcpAsyncServer(boost::asio::io_context &io_context, std::string ip, unsigned short port)
TCP Asynchronous server constructor.
void setReceiveSendHandler(boost::function< void(const boost::system::error_code &error, const char *receiveData, std::string &sendData)> receiveSendHandler)
To set the read handler.
void write(std::string sendData)
Function responsible of send the data through the socket.
void setWriteStatusHandler(boost::function< void(const boost::system::error_code &error, std::size_t size)> writeStatusHandler)
To set the write handler.
Connection class, responsible of send/receive data from any client or server. Regardless its communic...
Definition: tcpServer.h:26
boost::shared_ptr< TcpConnection > pointer
Pointer to TCP connection.
Definition: tcpServer.h:59
void publishMsg(const std::string &message)
Publish a message to all clients.