artefaktur
software engineer &        architecture

 
 
 
 

class ServerSocket

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::net::ServerSocket Class Reference

#include <ServerSocket.h>

Inheritance diagram for acdk::net::ServerSocket:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

API: Java.

Author:
Roger Rene Kommer, Maximilian Thoran
Version:
Revision
1.14
Date:
Date
2005/04/30 14:06:54


Public Member Functions

 ServerSocket (int port=-1)
 Creates a server socket on a specified port.

virtual ~ServerSocket ()
 ServerSocket (int port, int backlog)
 Creates a server socket and binds it to the specified local port number.

 ServerSocket (int port, int backlog, IN(RInetAddress) bindAddr)
 Create a server with the specified port, listen backlog, and local IP address to bind to.

RSocket accept (int timeOut=-1)
 Listens for a connection to be made to this socket and accepts it.

void close ()
 Closes this socket.

RInetAddress getInetAddress ()
 Returns the local address of this server socket.

int getLocalPort ()
 Returns the port on which this socket is listening.

int getSoTimeout ()
 Retrive setting for SO_TIMEOUT.

void setSoTimeout (int timeout)
 Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

bool getReuseAddress ()
 get SO_REUSEADDR flag

void setReuseAddress (bool on)
 set SO_REUSEADDR flag

bool getTcpNoDelay ()
 Tests if TCP_NODELAY is enabled.

void setTcpNoDelay (bool on)
 Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).

RString toString ()
 Returns the implementation address and implementation port of this socket as a String.


Static Public Member Functions

void setSocketFactory (IN(RSocketImplFactory) fac)
 Sets the server socket implementation factory for the application.


Protected Member Functions

bool implAccept (IN(RSocket) s, int timeOut)
 Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket.


Private Attributes

RSocketImpl _theSocket
int _backlog

Constructor & Destructor Documentation

acdk::net::ServerSocket::ServerSocket int  port = -1  ) 
 

Creates a server socket on a specified port.

if port == -1 os should select a port

virtual acdk::net::ServerSocket::~ServerSocket  )  [virtual]
 

acdk::net::ServerSocket::ServerSocket int  port,
int  backlog
 

Creates a server socket and binds it to the specified local port number.

acdk::net::ServerSocket::ServerSocket int  port,
int  backlog,
IN(RInetAddress bindAddr
 

Create a server with the specified port, listen backlog, and local IP address to bind to.


Member Function Documentation

RSocket acdk::net::ServerSocket::accept int  timeOut = -1  ) 
 

Listens for a connection to be made to this socket and accepts it.

Parameters:
timeOut in ms. if timeOut is -1 blocks forever
Returns:
return Nil if timeout is reached.

void acdk::net::ServerSocket::close  ) 
 

Closes this socket.

RInetAddress acdk::net::ServerSocket::getInetAddress  ) 
 

Returns the local address of this server socket.

int acdk::net::ServerSocket::getLocalPort  ) 
 

Returns the port on which this socket is listening.

bool acdk::net::ServerSocket::getReuseAddress  )  [inline]
 

get SO_REUSEADDR flag

int acdk::net::ServerSocket::getSoTimeout  ) 
 

Retrive setting for SO_TIMEOUT.

bool acdk::net::ServerSocket::getTcpNoDelay  )  [inline]
 

Tests if TCP_NODELAY is enabled.

bool acdk::net::ServerSocket::implAccept IN(RSocket s,
int  timeOut
[protected]
 

Subclasses of ServerSocket use this method to override accept() to return their own subclass of socket.

void acdk::net::ServerSocket::setReuseAddress bool  on  )  [inline]
 

set SO_REUSEADDR flag

void acdk::net::ServerSocket::setSocketFactory IN(RSocketImplFactory fac  )  [static]
 

Sets the server socket implementation factory for the application.

void acdk::net::ServerSocket::setSoTimeout int  timeout  ) 
 

Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.

void acdk::net::ServerSocket::setTcpNoDelay bool  on  )  [inline]
 

Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).

RString acdk::net::ServerSocket::toString  )  [virtual]
 

Returns the implementation address and implementation port of this socket as a String.

Reimplemented from acdk::lang::Object.


Member Data Documentation

int acdk::net::ServerSocket::_backlog [private]
 

RSocketImpl acdk::net::ServerSocket::_theSocket [private]
 

 
Last modified 2005-05-08 18:33 by SYSTEM By Artefaktur, Ing. Bureau Kommer