R-Type
Public Member Functions | List of all members
RType::Server::ClientSession Class Reference

Client Session that will handle every client's event. More...

#include <ClientSession.hpp>

Inheritance diagram for RType::Server::ClientSession:

Public Member Functions

 ClientSession (asio::io_context &IOContext)
 
 ~ClientSession ()
 
asio::ip::tcp::socket & getSocket ()
 Get the socket of the client session. More...
 
void start ()
 start that will waiting for a message from the client More...
 
std::shared_ptr< ClientSessionget ()
 Get the pointer of 'this' object. More...
 
void handleRead (const asio::error_code &error, std::size_t transferredBytes)
 handles the asynchronous wait on read for the client session More...
 
void handleWrite (const asio::error_code &error)
 handles the asynchronous wait on write to the client session More...
 

Detailed Description

Client Session that will handle every client's event.

Constructor & Destructor Documentation

◆ ClientSession()

RType::Server::ClientSession::ClientSession ( asio::io_context &  IOContext)

◆ ~ClientSession()

RType::Server::ClientSession::~ClientSession ( )

Member Function Documentation

◆ get()

std::shared_ptr< RType::Server::ClientSession > RType::Server::ClientSession::get ( )

Get the pointer of 'this' object.

Returns
'this'

◆ getSocket()

asio::ip::tcp::socket & RType::Server::ClientSession::getSocket ( )

Get the socket of the client session.

Returns
the client asio::ip::tcp::socket

◆ handleRead()

void RType::Server::ClientSession::handleRead ( const asio::error_code &  error,
std::size_t  transferredBytes 
)

handles the asynchronous wait on read for the client session

Parameters
errorchecked if error occures
transferredBytescorresponding to the received bytes from client

◆ handleWrite()

void RType::Server::ClientSession::handleWrite ( const asio::error_code &  error)

handles the asynchronous wait on write to the client session

Parameters
errorchecked if error occures

◆ start()

void RType::Server::ClientSession::start ( )

start that will waiting for a message from the client


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