Mixes for Privacy and Anonymity in the Internet
Public Member Functions | List of all members
CAClientSocket Class Referenceabstract
Inheritance diagram for CAClientSocket:
CASocket CATLSClientSocket

Public Member Functions

virtual ~CAClientSocket ()
 
virtual SINT32 sendFully (const UINT8 *buff, UINT32 len)=0
 Sends all data over the network. More...
 
virtual SINT32 receive (UINT8 *buff, UINT32 len)=0
 Will receive some bytes from the socket. More...
 
virtual SOCKET getSocket ()=0
 Returns the number of the Socket used. More...
 
SINT32 receiveFully (UINT8 *buff, UINT32 len)
 Receives all len bytes. More...
 

Constructor & Destructor Documentation

◆ ~CAClientSocket()

virtual CAClientSocket::~CAClientSocket ( )
virtual

Member Function Documentation

◆ getSocket()

virtual SOCKET CAClientSocket::getSocket ( )
pure virtual

Returns the number of the Socket used.

Which will be always the same number, even after close(), until the Socket is recreated using create()

Returns
number of the associated socket

Implemented in CASocket.

Referenced by receiveFully(), and ~CAClientSocket().

◆ receive()

virtual SINT32 CAClientSocket::receive ( UINT8 buff,
UINT32  len 
)
pure virtual

Will receive some bytes from the socket.

May block or not depending on the implementation.

Parameters
buffthe buffer which get the received data
lensize of buff
Returns
SOCKET_ERROR if an error occured
Return values
E_AGAIN,ifsocket was in non-blocking mode and receive would block or a timeout was reached
0if socket was gracefully closed
Returns
the number of bytes received (always >0)

Implemented in CASocket, and CATLSClientSocket.

Referenced by receiveFully(), and ~CAClientSocket().

◆ receiveFully()

SINT32 CAClientSocket::receiveFully ( UINT8 buff,
UINT32  len 
)

Receives all len bytes.

This blocks until all bytes are received or an error occured.

Returns
E_UNKNOWN, in case of an error
E_SUCCESS otherwise

References CASocketGroup::add(), E_AGAIN, E_SUCCESS, E_UNKNOWN, getSocket(), msSleep(), receive(), and CASocketGroup::select().

Referenced by CALocalProxy::init(), CALocalProxy::processKeyExchange(), CAMuxSocket::receive(), and ~CAClientSocket().

◆ sendFully()

virtual SINT32 CAClientSocket::sendFully ( const UINT8 buff,
UINT32  len 
)
pure virtual

Sends all data over the network.

This may block until all data is send.

Parameters
buff- the buffer of data to send
len- content length
Return values
E_UNKNOWN,ifan error occured
E_SUCCESS,ifsuccessful

Implemented in CASocket, and CATLSClientSocket.

Referenced by ~CAClientSocket().