ClientSocket Class Reference

This class implements client sockets (also called just "sockets"). More...

#include <ClientSocket.h>

Inheritance diagram for ClientSocket:

Inheritance graph
[legend]
Collaboration diagram for ClientSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ClientSocket ()
 Creates an unconnected socket.
 ClientSocket (std::string hostName, int port)
 Creates a stream socket and connects it to the specified port number on the named host.
int connect (std::string hostName, int port)
 Connects the socket to the specified port number on the named host.

Detailed Description

This class implements client sockets (also called just "sockets").

A socket is an endpoint for communication between two machines.

Author:
Daniel Aarno
Version:
v0.1.0
See also:
Socket

ServerSocket


Constructor & Destructor Documentation

ClientSocket::ClientSocket (  )  [inline]

Creates an unconnected socket.

ClientSocket::ClientSocket ( std::string  hostName,
int  port 
) [inline]

Creates a stream socket and connects it to the specified port number on the named host.

Parameters:
hostName The name of the host to connect to, ie "www.sf.net"
port The port on the server (host) to connect to, ie 80 for http
Exceptions:
You should check that Error() returns 0 after creating a ClientSocket with this constructor.


Member Function Documentation

int ClientSocket::connect ( std::string  hostName,
int  port 
)

Connects the socket to the specified port number on the named host.

Parameters:
hostName The name of the host to connect to, ie "www.sf.net"
port The port on the server (host) to connect to, ie 80 for http
Returns:
0 on success, othervise an error number indicating what went wrong


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7