Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

P::StreamSocketServer Class Reference
[Networking library]

Stream socket server. More...

#include <psocket.h>

Inheritance diagram for P::StreamSocketServer:

P::Socket P::IODevice List of all members.

Public Member Functions

 StreamSocketServer (int domain) throw (IOError)
 Protocol domain constructor.

 StreamSocketServer (const NetworkAddress &addr, port_t port) throw (IOError)
 Listen constructor.

 ~StreamSocketServer () throw ()
 Destructor.

void listen () throw (IOError)
 Listen for incoming connections.

bool waitClient (unsigned int timeout) throw (IOError)
 Wait for client.

void getName (NetworkAddress &addr, port_t &port) const throw (LogicError,IOError)
 Get the address and port the Socket is bound to.


Protected Member Functions

io_handle_t accept () throw (IOError)
 Accept the pending connection.


Friends

class StreamSocket

Detailed Description

Stream socket server.

Author:
Christian Prochnow <cproch@seculogix.de>

Definition at line 132 of file psocket.h.


Constructor & Destructor Documentation

P::StreamSocketServer::StreamSocketServer int  domain  )  throw (IOError)
 

Protocol domain constructor.

Constructs a stream server socket for the given protocol domain. The socket can then be used to listen for and accept incoming client connections.

Parameters:
domain the protocol domain to use. supported domains are AF_INET, AF_INET6, AF_IPX and AF_ATALK.
Exceptions:
IOError 

P::StreamSocketServer::StreamSocketServer const NetworkAddress addr,
port_t  port
throw (IOError)
 

Listen constructor.

Constructs a stream server socket that is bound to the given address and listen's for client connections.

Parameters:
addr the network address to bind to
port the port on which the socket should be bound
Exceptions:
IOError 

P::StreamSocketServer::~StreamSocketServer  )  throw ()
 

Destructor.


Member Function Documentation

io_handle_t P::StreamSocketServer::accept  )  throw (IOError) [protected]
 

Accept the pending connection.

void P::StreamSocketServer::getName NetworkAddress addr,
port_t port
const throw (LogicError,IOError) [inline]
 

Get the address and port the Socket is bound to.

Reimplemented from P::Socket.

Definition at line 178 of file psocket.h.

void P::StreamSocketServer::listen  )  throw (IOError)
 

Listen for incoming connections.

Listen for incoming connections on socket. The socket must be bound to an address before listening. Use Socket::bind() to bind the socket to an address.

Exceptions:
IOError 

bool P::StreamSocketServer::waitClient unsigned int  timeout  )  throw (IOError)
 

Wait for client.

Waits for a client to connect to the socket server.

Parameters:
timeout timeout in milliseconds.
Returns:
true if a client has connected, false otherwise.


Friends And Related Function Documentation

friend class StreamSocket [friend]
 

Definition at line 134 of file psocket.h.


The documentation for this class was generated from the following file:
Generated on Fri Mar 12 21:08:37 2004 for P::Classes by doxygen 1.3.3