#include <tcpsocket.h>
Inheritance diagram for TCPSocket::

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.
Definition at line 33 of file tcpsocket.cc. |
|
|
Destructor.
Definition at line 39 of file tcpsocket.cc. |
|
|
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(). |
|
|
Open a connection on the specified "port" for listening (Server-side call).
Definition at line 53 of file tcpsocket.cc. Referenced by DataServer::Start(). |
|
|
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(). |
|
|
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(). |
|
|
Disconnect/close client connection from server (Client-side call).
Definition at line 135 of file tcpsocket.cc. Referenced by DataClient::Disconnect(). |
|
||||||||||||
|
Connect to "server" on "port" (Client-side call).
Reimplemented in DataClient. Definition at line 71 of file tcpsocket.cc. Referenced by DataClient::Connect(). |
|
|
Stop listening on "port" established by Bind() (Server-side call).
Definition at line 140 of file tcpsocket.cc. |
|
|
Listen on the "port" established by Bind() (Server-side call).
Definition at line 145 of file tcpsocket.cc. Referenced by DataServer::Start(). |
|
|
Operator overloading for copying TCPSocket structure.
Definition at line 265 of file tcpsocket.cc. References INetAddress, recvfd, RemoteAddress, and sockfd. |
|
|
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. |
|
|
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. |
|
||||||||||||
|
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(). |
|
|
Network bandwidth (in Mbps) for data received.
Reimplemented in DataClient, and DataServer. Definition at line 65 of file tcpsocket.h. |
|
|
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(). |
|
||||||||||||
|
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(). |
|
|
Network bandwidth (in Mbps) for data sent.
Reimplemented in DataClient, and DataServer. Definition at line 62 of file tcpsocket.h. |
|
|
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(). |
|
|
Name of the machine from which the connection is being initiated (Both client/server can call).
Definition at line 206 of file tcpsocket.cc. |
|
|
Port from which the connection is being initiated (Both client/server can call).
Definition at line 223 of file tcpsocket.cc. |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001