Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TCPSocket Class Reference

#include <tcpsocket.h>

Inheritance diagram for TCPSocket::

RemoteSocket DataClient DataServer DataServerMPI List of all members.

Public Methods

 TCPSocket ()
 Constructor. More...

 ~TCPSocket ()
 Destructor. More...

bool Bind (int port)
 Open a connection on the specified "port" for listening (Server-side call). More...

bool Listen ()
 Listen on the "port" established by Bind() (Server-side call). More...

bool Accept ()
 Accept connection from Client on "port" established by Bind() (Server-side call). This is a blocking call that returns only when a client connection on the port is detected. More...

bool Connect (char *server, int port)
 Connect to "server" on "port" (Client-side call). More...

int SendBytes (int size, const void *data)
 Send "size" bytes of data pointed by "data" (Both client/server can call). This is a blocking call which waits indefinitely until the "size" bytes of data has been sent. More...

int RecvBytes (int size, void *data)
 Recv "size" bytes of data pointed by "data" (Both client/server can call). This is a blocking call which waits indefinitely until the "size" bytes of data has been received. More...

bool Close ()
 Disconnect/close client connection from server (Client-side call). More...

bool InboundClose ()
 Stop listening on "port" established by Bind() (Server-side call). More...

char * SocketName ()
 Name of the machine from which the connection is being initiated (Both client/server can call). More...

int SocketPort ()
 Port from which the connection is being initiated (Both client/server can call). More...

char * PeerName ()
 Name of the peer machine to which the connection has been established ((Both client/server can call). More...

int PeerPort ()
 Port of the peer machine to which the connection has been established (Both client/server can call). More...

double BytesSent ()
 Total number of bytes sent through the TCPSocket class. More...

double BytesRecd ()
 Total number of bytes received through the TCPSocket class. More...

int SendTime ()
 Time to send BytesSent() bytes of data (in ms). More...

int RecvTime ()
 Time to receive BytesRecd() bytes of data (in ms). More...

double SendRate ()
 Network bandwidth (in Mbps) for data sent. More...

double RecvRate ()
 Network bandwidth (in Mbps) for data received. More...

TCPSocket & operator= (const TCPSocket &)
 Operator overloading for copying TCPSocket structure. More...


Constructor & Destructor Documentation

TCPSocket::TCPSocket  
 

Constructor.

Definition at line 33 of file tcpsocket.cc.

TCPSocket::~TCPSocket  
 

Destructor.

Definition at line 39 of file tcpsocket.cc.


Member Function Documentation

bool TCPSocket::Accept  
 

Accept connection from Client on "port" established by Bind() (Server-side call). This is a blocking call that returns only when a client connection on the port is detected.

Definition at line 156 of file tcpsocket.cc.

References BlockSocket().

Referenced by DataServer::AcceptClient().

bool TCPSocket::Bind int    port
 

Open a connection on the specified "port" for listening (Server-side call).

Definition at line 53 of file tcpsocket.cc.

Referenced by DataServer::Start().

double TCPSocket::BytesRecd  
 

Total number of bytes received through the TCPSocket class.

Reimplemented in DataClient, and DataServer.

Definition at line 250 of file tcpsocket.cc.

Referenced by DataServer::BytesRecd(), DataClient::BytesRecd(), and RecvRate().

double TCPSocket::BytesSent  
 

Total number of bytes sent through the TCPSocket class.

Reimplemented in DataClient, and DataServer.

Definition at line 245 of file tcpsocket.cc.

Referenced by DataServer::BytesSent(), DataClient::BytesSent(), and SendRate().

bool TCPSocket::Close  
 

Disconnect/close client connection from server (Client-side call).

Definition at line 135 of file tcpsocket.cc.

Referenced by DataClient::Disconnect().

bool TCPSocket::Connect char *    host,
int    port
 

Connect to "server" on "port" (Client-side call).

Reimplemented in DataClient.

Definition at line 71 of file tcpsocket.cc.

Referenced by DataClient::Connect().

bool TCPSocket::InboundClose  
 

Stop listening on "port" established by Bind() (Server-side call).

Definition at line 140 of file tcpsocket.cc.

bool TCPSocket::Listen  
 

Listen on the "port" established by Bind() (Server-side call).

Definition at line 145 of file tcpsocket.cc.

Referenced by DataServer::Start().

TCPSocket & TCPSocket::operator= const TCPSocket &    T
 

Operator overloading for copying TCPSocket structure.

Definition at line 265 of file tcpsocket.cc.

References INetAddress, recvfd, RemoteAddress, and sockfd.

char * TCPSocket::PeerName  
 

Name of the peer machine to which the connection has been established ((Both client/server can call).

Definition at line 178 of file tcpsocket.cc.

int TCPSocket::PeerPort  
 

Port of the peer machine to which the connection has been established (Both client/server can call).

Definition at line 195 of file tcpsocket.cc.

int TCPSocket::RecvBytes int    size,
void *    data
 

Recv "size" bytes of data pointed by "data" (Both client/server can call). This is a blocking call which waits indefinitely until the "size" bytes of data has been received.

Definition at line 117 of file tcpsocket.cc.

References ERR_RECV_MESG, recv_all(), and RECV_FLAG.

Referenced by RemoteSocket::RecvArray1D(), RemoteSocket::RecvArray2D(), RemoteSocket::RecvArray3D(), RemoteSocket::RecvArray4D(), RemoteSocket::RecvArrayGeneric(), RemoteSocket::RecvFile(), RemoteSocket::RecvLine(), and RemoteSocket::RecvVar().

double TCPSocket::RecvRate   [inline]
 

Network bandwidth (in Mbps) for data received.

Reimplemented in DataClient, and DataServer.

Definition at line 65 of file tcpsocket.h.

References BytesRecd(), and RecvTime().

int TCPSocket::RecvTime  
 

Time to receive BytesRecd() bytes of data (in ms).

Reimplemented in DataClient, and DataServer.

Definition at line 260 of file tcpsocket.cc.

Referenced by RecvRate(), DataServer::RecvTime(), and DataClient::RecvTime().

int TCPSocket::SendBytes int    size,
const void *    data
 

Send "size" bytes of data pointed by "data" (Both client/server can call). This is a blocking call which waits indefinitely until the "size" bytes of data has been sent.

Definition at line 99 of file tcpsocket.cc.

References ERR_SEND_MESG, and send_all().

Referenced by RemoteSocket::SendArray1D(), RemoteSocket::SendArray2D(), RemoteSocket::SendArray3D(), RemoteSocket::SendArray4D(), RemoteSocket::SendArrayGeneric(), RemoteSocket::SendFile(), RemoteSocket::SendLine(), and RemoteSocket::SendVar().

double TCPSocket::SendRate   [inline]
 

Network bandwidth (in Mbps) for data sent.

Reimplemented in DataClient, and DataServer.

Definition at line 62 of file tcpsocket.h.

References BytesSent(), and SendTime().

int TCPSocket::SendTime  
 

Time to send BytesSent() bytes of data (in ms).

Reimplemented in DataClient, and DataServer.

Definition at line 255 of file tcpsocket.cc.

Referenced by SendRate(), DataServer::SendTime(), and DataClient::SendTime().

char * TCPSocket::SocketName  
 

Name of the machine from which the connection is being initiated (Both client/server can call).

Definition at line 206 of file tcpsocket.cc.

int TCPSocket::SocketPort  
 

Port from which the connection is being initiated (Both client/server can call).

Definition at line 223 of file tcpsocket.cc.


The documentation for this class was generated from the following files:
Generated on Sun Jun 16 17:36:52 2002 for POSSE: Portable Object-oriented Scientific Steering Environment by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001