ServerSocket Class Reference

This class implements server sockets. More...

#include <ServerSocket.h>

Inheritance diagram for ServerSocket:

Inheritance graph
[legend]
Collaboration diagram for ServerSocket:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ServerSocket ()
 Creates an unconnected server socket.
 ServerSocket (int port)
 Creates a server socket that listens on a specified port.
int listen (int port)
 Make this socket listen on a port.
Socket accept ()
 Accept connection on the port this server is listening to.

Protected Attributes

int port
 The port this server is listening on.
int maxConnectQ
 Maximum numer of connection allowed in the connection queue.

Detailed Description

This class implements server sockets.

A server socket waits for requests to come in over the network. When a request (connection) is received it establishes a connection on a Socket objekt that can be used for further communication.

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

ClientSocket


Constructor & Destructor Documentation

ServerSocket::ServerSocket (  )  [inline]

Creates an unconnected server socket.

ServerSocket::ServerSocket ( int  port  )  [inline]

Creates a server socket that listens on a specified port.

Parameters:
port The port the server should listen on.
Exceptions:
Check Error() after using this contructor


Member Function Documentation

Socket ServerSocket::accept (  ) 

Accept connection on the port this server is listening to.

Returns:
A new Socket connected to the remote host, NULL on error.
Exceptions:
If this method returns NULL you should check the Error() function.

int ServerSocket::listen ( int  port  ) 

Make this socket listen on a port.

Parameters:
port The port the server should listen on.
Returns:
0 on success, othervise an error number indicating what went wrong.


Member Data Documentation

int ServerSocket::maxConnectQ [protected]

Maximum numer of connection allowed in the connection queue.

int ServerSocket::port [protected]

The port this server is listening on.


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