Public Types

enum  status { unlink, link, linkRemoteClose, error }
 

Public Member Functions

 Tcp (int32_t _idSocket, const std::string &_name)
 
 Tcp (Tcp &&_obj)
 
Tcpoperator= (Tcp &&_obj)
 
Tcpoperator= (Tcp &_obj)=delete
 
const std::string & getName ()
 
enum status getConnectionStatus () const
 
bool unlink ()
 
int32_t read (void *_data, int32_t _maxLen)
 
int32_t write (const void *_data, int32_t _len)
 
int32_t write (const std::string &_data, bool _writeBackSlashZero=true)
 
template<class T >
int32_t write (const std::vector< T > &_data)
 
bool setTCPNoDelay (bool _enabled)
 

Member Function Documentation

§ getConnectionStatus()

enum status enet::Tcp::getConnectionStatus ( ) const
inline

Get the current Status of the connection.

Returns
The status.

§ getName()

const std::string& enet::Tcp::getName ( )
inline

Get the decriptive name hot the host:port.

Returns
the string requested

§ read()

int32_t enet::Tcp::read ( void *  _data,
int32_t  _maxLen 
)

Read a chunk of data on the socket.

Parameters
[in]_datapointer on the data might be write
[in]_maxLenSize that can be written on the pointer
Returns
>0 byte size on the socket read
-1 an error occured.

§ unlink()

bool enet::Tcp::unlink ( )

Unlink on a specific interface.

Returns
true if connection is removed
false otherwise ...

§ write() [1/3]

int32_t enet::Tcp::write ( const void *  _data,
int32_t  _len 
)

Write a chunk of data on the socket.

Parameters
[in]_datapointer on the data might be write
[in]_lenSize that must be written socket
Returns
>0 byte size on the socket write
-1 an error occured.

§ write() [2/3]

int32_t enet::Tcp::write ( const std::string &  _data,
bool  _writeBackSlashZero = true 
)
inline

Write a chunk of data on the socket.

Parameters
[in]_dataString to rite on the soccket
[in]_writeBackSlashZeroif false, the \0 is not write
Returns
>0 byte size on the socket write
-1 an error occured.

§ write() [3/3]

template<class T >
int32_t enet::Tcp::write ( const std::vector< T > &  _data)
inline

Write a chunk of data on the socket.

Parameters
[in]_dataString to rite on the soccket
[in]_writeBackSlashZeroif false, the \0 is not write
Returns
>0 T element write on the socket
-1 an error occured.

The documentation for this class was generated from the following file:
  • framework/atria-soft/enet/enet/Tcp.hpp