Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
TCP_Session Class Reference

implementation connection handler for TCP More...

#include <network.h>

Inheritance diagram for TCP_Session:
Inheritance graph
[legend]

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]
Enumerator:
max_length 

Definition at line 196 of file network.h.


Constructor & Destructor Documentation

TCP_Session::TCP_Session ( boost::asio::io_service &  io_service,
SIG_ON_DATA cb 
) [inline]

Definition at line 81 of file network.h.

virtual TCP_Session::~TCP_Session ( ) [inline, virtual]

Definition at line 86 of file network.h.


Member Function Documentation

virtual void TCP_Session::close ( ) [inline, virtual]

Definition at line 128 of file network.h.

virtual bool TCP_Session::connect ( const std::string &  path,
const std::string &  service 
) [inline, virtual]

Definition at line 95 of file network.h.

virtual bool TCP_Session::connect ( const boost::asio::ip::tcp::resolver::endpoint_type &  ep) [inline, virtual]

Definition at line 110 of file network.h.

void TCP_Session::handle_read ( const boost::system::error_code &  error,
size_t  bytes_transferred 
) [inline, private]

called on incoming data --> decides if an error occured or calls handler

Definition at line 160 of file network.h.

void TCP_Session::handle_write ( const boost::system::error_code &  error) [inline, private]

called if data is written (error handling)

Definition at line 183 of file network.h.

boost::asio::ip::tcp::socket& TCP_Session::socket ( ) [inline]

getter for socket connection

Definition at line 90 of file network.h.

virtual void TCP_Session::write ( const std::string &  buffer) [inline, protected, virtual]

write async. to TCP socket (implement abstract)

Implements Any_Session.

Definition at line 136 of file network.h.

virtual void TCP_Session::write ( const std::vector< char > &  buffer) [inline, protected, virtual]

Definition at line 142 of file network.h.

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

char TCP_Session::data_[max_length] [protected]

data buffer of max. length

Definition at line 197 of file network.h.

boost::mutex TCP_Session::mtx_ [protected]

lock operations

Definition at line 198 of file network.h.

boost::asio::ip::tcp::socket TCP_Session::socket_ [protected]

TCP socket.

Definition at line 195 of file network.h.


The documentation for this class was generated from the following file:


sick_visionary_t_driver
Author(s): Joshua Hampp
autogenerated on Sat Jun 8 2019 19:04:06