Rudiments
Public Member Functions
serversocket Class Reference

Inherits server.

Inherited by inetserversocket, and unixserversocket.

List of all members.

Public Member Functions

 serversocket ()
 serversocket (const serversocket &s)
serversocketoperator= (const serversocket &s)
virtual ~serversocket ()
virtual bool supportsBlockingNonBlockingModes ()
virtual bool useNonBlockingMode () const
virtual bool useBlockingMode () const
virtual bool isUsingNonBlockingMode () const
virtual int32_t ioCtl (int32_t command, void *arg) const
bool lingerOnClose (int32_t timeout)
bool dontLingerOnClose ()
bool reuseAddresses ()
bool dontReuseAddresses ()
virtual bool listen (int32_t backlog)

Detailed Description

The serversocket class provides a base class for classes that implement the server side of a client-server communication model over a socket.


Constructor & Destructor Documentation

serversocket::serversocket ( )

Creates an instance of the serversocket class.

serversocket::serversocket ( const serversocket s)

Creates an instance of the serversocket class that is a copy of "s".

virtual serversocket::~serversocket ( ) [virtual]

Deletes this instance of the serversocket class.


Member Function Documentation

bool serversocket::dontLingerOnClose ( )

Instructs the socket to close immediately when close() is called, dumping any data that may still be buffered but that it may not have received. This is the default.

Returns true on success and false on failure.

bool serversocket::dontReuseAddresses ( )

Prevents sockets in the TIME_WAIT state from being reused. This is the default.

Returns true on success and false on failure.

virtual int32_t serversocket::ioCtl ( int32_t  command,
void *  arg 
) const [virtual]

Use the ioctl() system call to perform various low-level file descriptor operations.

Reimplemented from filedescriptor.

virtual bool serversocket::isUsingNonBlockingMode ( ) const [virtual]

Returns true if the file descriptor is in non-blocking mode and false otherwise.

Reimplemented from filedescriptor.

bool serversocket::lingerOnClose ( int32_t  timeout)

Instructs the socket to stay open for "timeout" seconds even after close() is called to allow it to receive any data that may still be buffered. The default is not to linger on close.

Returns true on success and false on failure.

virtual bool serversocket::listen ( int32_t  backlog) [virtual]

Waits until a client connects then places that connection in queue. Up to "backlog" connections may be queued before future conenctions are refused.

Returns true on success and false on failure.

Implements server.

Reimplemented in inetserversocket, and unixserversocket.

serversocket& serversocket::operator= ( const serversocket s)

Makes this instance of the serversocket class identical to "s".

bool serversocket::reuseAddresses ( )

Allows sockets in the TIME_WAIT state to be reused. The default is to allocate a new socket.

Returns true on success and false on failure.

virtual bool serversocket::supportsBlockingNonBlockingModes ( ) [virtual]

Returns false if the system doesn't support blocking/nonblocking modes and true otherwise.

Reimplemented from filedescriptor.

virtual bool serversocket::useBlockingMode ( ) const [virtual]

Puts the file descriptor in blocking mode. Returns true on success and false on failure. Returns false if the system doesn't support blocking/nonblocking modes.

Reimplemented from filedescriptor.

virtual bool serversocket::useNonBlockingMode ( ) const [virtual]

Puts the file descriptor in non-blocking mode. Returns true on success and false on failure. Returns false if the system doesn't support blocking/nonblocking modes.

Reimplemented from filedescriptor.