Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

TCPSocket Class Reference

#include <TCPSocket.h>

Inheritance diagram for TCPSocket:

Socket List of all members.

Public Member Functions

 TCPSocket ()
 ~TCPSocket ()
void Open (int fd=0)
 Open a new tcp socket or use a previously opened one.
void Send (const DCDT_Msg *msg)
 Send a message using a connection-orientend protocol ( tcp ).
DCDT_MsgReceive ()
 Receive a message.
void Listen (int qlen=5)
 Listen for connections.
TCPSocketAccept ()
 Accept a new connection.
void SetBufs (int rcvbuf, int sndbuf, int rcvlowat, int sndlowat)
void SetSegSize (int size)

Constructor & Destructor Documentation

TCPSocket::TCPSocket  )  [inline]
 

Definition at line 35 of file TCPSocket.h.

Referenced by Accept().

TCPSocket::~TCPSocket  )  [inline]
 

Definition at line 36 of file TCPSocket.h.


Member Function Documentation

TCPSocket * TCPSocket::Accept  )  [inline]
 

Accept a new connection.

Used only the conn timer.

Exceptions:
TimeOut No connection request in queue
ConnError 
ChannelError 
Returns:
NULL - No connection request in queue

!=NULL - Pointer to the TCP socket connected to a remote socket

Definition at line 324 of file TCPSocket.h.

References Socket::ConnTimerOn(), DCDT_TRC_COMM, Socket::LostTimerOn(), Open(), Socket::ReceiveTimerOn(), Socket::SendTimerOn(), Socket::SetConnTimer(), Socket::SetLostTimer(), Socket::SetReceiveTimer(), Socket::SetSendTimer(), TCPSocket(), and TRC_PRINT.

Referenced by DCDT_Channel_IP::WaitConn().

void TCPSocket::Listen int  qlen = 5  )  [inline]
 

Listen for connections.

Exceptions:
ChannelError 

Definition at line 304 of file TCPSocket.h.

References DCDT_TRC_COMM, and TRC_PRINT.

Referenced by DCDT_Channel_IP::Open(), and DCDT_Channel_IP::Reopen().

void TCPSocket::Open int  fd = 0  )  [inline, virtual]
 

Open a new tcp socket or use a previously opened one.

If fd!=0, a valid socket descriptor was passed, get the informations about the remote and set connected=1.

Exceptions:
ChannelError 

Implements Socket.

Definition at line 53 of file TCPSocket.h.

References DCDT_TRC_COMM, and TRC_PRINT.

Referenced by Accept(), DCDT_Channel_IP::Open(), and DCDT_Channel_IP::Reopen().

DCDT_Msg * TCPSocket::Receive  )  [inline, virtual]
 

Receive a message.

Such as in Send receive a message in two steps, first the header then the payload; a new DCDT_Msg object is created and returned when a message was received, is up to the user to delete the object. Timers precedence: unblock, receive, lost.

Exceptions:
ConnErr 
Returns:
NULL - No message was received

!=NULL - Pointer to the recived message, is up to the user to delete the returned object.

Implements Socket.

Definition at line 165 of file TCPSocket.h.

References DCDT_MsgHeader, DCDT_TRC_COMM, DCDT_Msg::ReadPayloadLen(), DCDT_Msg::SetPayload(), and TRC_PRINT.

Referenced by DCDT_Channel_IP::Receive(), and DCDT_Channel_IP::WaitConn().

void TCPSocket::Send const DCDT_Msg msg  )  [inline, virtual]
 

Send a message using a connection-orientend protocol ( tcp ).

Send the message msg in two steps:

  1. Send the header
  2. Send the payload
There are no limits on the legth of both header and payload. Timers precedence: unlock, send, lost.
Exceptions:
ChannelError 
TimeOut 

Implements Socket.

Definition at line 85 of file TCPSocket.h.

References DCDT_TRC_COMM, DCDT_Msg::GetHeader(), DCDT_Msg::GetPayload(), DCDT_Msg::ReadPayloadLen(), and TRC_PRINT.

Referenced by DCDT_Channel_IP::Send(), and DCDT_Channel_IP::StartConn().

void TCPSocket::SetBufs int  rcvbuf,
int  sndbuf,
int  rcvlowat,
int  sndlowat
[inline]
 

Definition at line 384 of file TCPSocket.h.

References DCDT_TRC_COMM, Socket::GetOption(), and TRC_PRINT.

Referenced by DCDT_Channel_IP::Open(), and DCDT_Channel_IP::Reopen().

void TCPSocket::SetSegSize int  size  )  [inline]
 

Definition at line 412 of file TCPSocket.h.

References DCDT_TRC_COMM, Socket::GetOption(), and TRC_PRINT.


The documentation for this class was generated from the following file:
Generated on Sun Jun 19 10:35:51 2005 for dcdt by  doxygen 1.3.9.1