TcpSocket Class Reference

#include <TcpSocket.h>

List of all members.


Public Member Functions

 TcpSocket ()
 Public constructor.
virtual ~TcpSocket ()
 Vitual destructor.
common::ErrorCodeType Open (IpAddress &rIpAddress)
 Opens socket.
common::ErrorCodeType Accept (TcpSocket &rSocket, bool block)
 Accepts connection.
common::ErrorCodeType GetPeerAddress (IpAddress &rAddress)
 Gets peer address.
common::ErrorCodeType Send (const void *pData, size_t byteCount)
 Sends data to socket.
common::ErrorCodeType Receive (void *pData, int maxByteCount, int &rActualByteCount)
 Receives data from socket.
common::ErrorCodeType Close ()
 Closes socket.

Private Attributes

TCPsocket m_TcpSocket
 Private socket data.

Friends

class SocketSet
 Friend of SocketSet.

Detailed Description

TcpSocket class.
Full Description
This class provides TCP socket functionality.

Constructor & Destructor Documentation

TcpSocket (  ) 

Public constructor.

Full Description
This method creates a new instance of the class.
Returns:
New instance of the class.

~TcpSocket (  )  [virtual]

Vitual destructor.

Full Description
This method destroys an existing instance of the class.
Returns:
None.


Member Function Documentation

common::ErrorCodeType Open ( IpAddress rIpAddress  ) 

Opens socket.

Full Description
This method opens the socket.
Returns:
Success if successful.

Failure otherwise.

Parameters:
rIpAddress  Address to open.

common::ErrorCodeType Accept ( TcpSocket rSocket,
bool  block 
)

Accepts connection.

Full Description
This method accepts a connection.
Returns:
Success if successful.

Failure otherwise.

Parameters:
rSocket  Socket to accept.
block  True if we want to block.

common::ErrorCodeType GetPeerAddress ( IpAddress rAddress  ) 

Gets peer address.

Full Description
This method gets the peer address of the socket.
Returns:
Success if successful.

Failure otherwise.

Parameters:
rAddress  Peer address.

common::ErrorCodeType Send ( const void *  pData,
size_t  byteCount 
)

Sends data to socket.

Full Description
This method sends data to the socket.
Returns:
Success if successful.

Failure otherwise.

Parameters:
pData  Data pointer.
byteCount  Byte count.

common::ErrorCodeType Receive ( void *  pData,
int  maxByteCount,
int &  rActualByteCount 
)

Receives data from socket.

Full Description
This method receives data from the socket.
Returns:
Success if successful.

Failure otherwise.

Parameters:
pData  Data pointer.
maxByteCount  Max byte count.
rActualByteCount  Actual byte count.

common::ErrorCodeType Close (  ) 

Closes socket.

Full Description
This method closes the socket.
Returns:
Always returns ERROR_CODE_SUCCESS.


Friends And Related Function Documentation

friend class SocketSet [friend]

Friend of SocketSet.


Member Data Documentation

TCPsocket m_TcpSocket [private]

Private socket data.


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