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...
 
SINT32 receiveFully (UINT8 *buff, UINT32 len)
 Receives all len bytes. More...
 

Constructor & Destructor Documentation

◆ ~CAClientSocket()

virtual CAClientSocket::~CAClientSocket ( )
virtual

References len, receive(), and sendFully().

Member Function Documentation

◆ 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 E_AGAIN, E_SUCCESS, E_UNKNOWN, msSleep(), and receive().

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

◆ 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().