Public Member Functions | Private Member Functions | Private Attributes

Session Class Reference

#include <Session.h>

Inheritance diagram for Session:

List of all members.

Public Member Functions

 Session (asio::io_service &io_service, boost::function< void(boost::shared_ptr< Session >)> ef)
void connect (asio::ip::tcp::resolver::iterator &iterator)
asio::ip::tcp::socket & getSocket ()
std::string getRemoteAddress ()
unsigned short getRemotePort ()
void push (int size, char *data)
bool pop (int &size, char **data)
void asyncReadHeader ()
void asyncWrite (int size, const char *data)
bool isConnected ()
void disconnect ()

Private Member Functions

void _signal ()
void asyncReadHeaderHandler (const asio::error_code &error, std::size_t bytes_transferred)
void asyncReadHandler (const asio::error_code &error, std::size_t bytes_transferred)
void asyncWriteHeaderHandler (const asio::error_code &ec)
void asyncWriteHandler (const asio::error_code &ec)

Private Attributes

asio::ip::tcp::socket socket
abicollab::mutex queue_protector
std::deque< std::pair< int,
char * > > 
std::deque< std::pair< int,
char * > > 
int packet_size
char * packet_data
int packet_size_write
char * packet_data_write
boost::function< void(boost::shared_ptr
< Session >)> 

Constructor & Destructor Documentation

Session::Session ( asio::io_service &  io_service,
boost::function< void(boost::shared_ptr< Session >)>  ef 
) [inline]

Member Function Documentation

void Session::_signal (  )  [inline, private]

References m_ef, and UT_DEBUGMSG.

void Session::asyncReadHandler ( const asio::error_code &  error,
std::size_t  bytes_transferred 
) [inline, private]
void Session::asyncReadHeader (  )  [inline]
void Session::asyncReadHeaderHandler ( const asio::error_code &  error,
std::size_t  bytes_transferred 
) [inline, private]
void Session::asyncWrite ( int  size,
const char *  data 
) [inline]
void Session::asyncWriteHandler ( const asio::error_code &  ec  )  [inline, private]
void Session::asyncWriteHeaderHandler ( const asio::error_code &  ec  )  [inline, private]
void Session::connect ( asio::ip::tcp::resolver::iterator &  iterator  )  [inline]

References socket.

void Session::disconnect ( void   )  [inline]
std::string Session::getRemoteAddress (  )  [inline]

References socket.

unsigned short Session::getRemotePort (  )  [inline]

References socket.

asio::ip::tcp::socket& Session::getSocket (  )  [inline]

References socket.

bool Session::isConnected (  )  [inline]

References socket.

bool Session::pop ( int &  size,
char **  data 
) [inline]

References incoming, and queue_protector.

void Session::push ( int  size,
char *  data 
) [inline]

Member Data Documentation

std::deque< std::pair<int, char*> > Session::incoming [private]

Referenced by pop(), and push().

boost::function<void (boost::shared_ptr<Session>)> Session::m_ef [private]

Referenced by _signal().

std::deque< std::pair<int, char*> > Session::outgoing [private]

Referenced by asyncWrite(), and asyncWriteHandler().

Referenced by pop(), and push().

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