implementation connection handler for TCP
More...
#include <network.h>
List of all members.
Public Member Functions |
virtual void | close () |
virtual bool | connect (const std::string &path, const std::string &service) |
virtual bool | connect (const boost::asio::ip::tcp::resolver::endpoint_type &ep) |
boost::asio::ip::tcp::socket & | socket () |
| getter for socket connection
|
| TCP_Session (boost::asio::io_service &io_service, SIG_ON_DATA &cb) |
virtual | ~TCP_Session () |
Protected Types |
enum | { max_length = 4096
} |
Protected Member Functions |
virtual void | write (const std::string &buffer) |
| write async. to TCP socket (implement abstract)
|
virtual void | write (const std::vector< char > &buffer) |
virtual void | write (const boost::asio::mutable_buffers_1 &buffer) |
| write async. to TCP socket
|
Protected Attributes |
char | data_ [max_length] |
| data buffer of max. length
|
boost::mutex | mtx_ |
| lock operations
|
boost::asio::ip::tcp::socket | socket_ |
| TCP socket.
|
Private Member Functions |
void | handle_read (const boost::system::error_code &error, size_t bytes_transferred) |
| called on incoming data --> decides if an error occured or calls handler
|
void | handle_write (const boost::system::error_code &error) |
| called if data is written (error handling)
|
Detailed Description
implementation connection handler for TCP
Definition at line 77 of file network.h.
Member Enumeration Documentation
anonymous enum [protected] |
Constructor & Destructor Documentation
Member Function Documentation
virtual bool TCP_Session::connect |
( |
const std::string & |
path, |
|
|
const std::string & |
service |
|
) |
| [inline, virtual] |
virtual bool TCP_Session::connect |
( |
const boost::asio::ip::tcp::resolver::endpoint_type & |
ep | ) |
[inline, virtual] |
called on incoming data --> decides if an error occured or calls handler
Definition at line 160 of file network.h.
called if data is written (error handling)
Definition at line 183 of file network.h.
getter for socket connection
Definition at line 90 of file network.h.
virtual void TCP_Session::write |
( |
const std::string & |
buffer | ) |
[inline, protected, virtual] |
virtual void TCP_Session::write |
( |
const std::vector< char > & |
buffer | ) |
[inline, protected, virtual] |
virtual void TCP_Session::write |
( |
const boost::asio::mutable_buffers_1 & |
buffer | ) |
[inline, protected, virtual] |
write async. to TCP socket
Definition at line 150 of file network.h.
Member Data Documentation
data buffer of max. length
Definition at line 197 of file network.h.
The documentation for this class was generated from the following file: