Main Page   Class Hierarchy   Compound List   Header Files   Compound Members  

BGServerSocket Class Reference

Server socket. More...

#include <bgsocket.h>

Class diagram for BGServerSocket:

BGObject

List of all members.


Public Members

 BGServerSocket (long port)
Creates a server socket on a specified port. More...

 BGServerSocket (long port, long backlog)
Creates a server socket and binds it to the specified local port number. More...

 BGServerSocket (long port, long backlog, BGInetAddress bindAddress)
Create a server with the specified port, listen backlog, and local IP address to bind to. More...

virtual BGString toString ( )
Generates string representation of this object. More...

virtual unsigned long hash ( )
Generates a 'unique' hashvalue of this object. More...

virtual bool equals (BGObject &obj)
Returns true, if specified object is equal to own instance. More...

virtual BGString className ( )
Return the class name for this class. More...

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

BGSocket accept ( )
Listen for a connection to be made to this socket and accepts it. More...

void close ( )
Closes this socket.


Detailed Description

Server socket.

Author(s):
Michael Griffel
Version:
1.0

Member Function Documentation

BGServerSocket::BGServerSocket (long port)

Creates a server socket on a specified port.

Parameters:
port   Port number, or 0 to use any free port

BGServerSocket::BGServerSocket (long port, long backlog)

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

Parameters:
port   Port number, or 0 to use any free port
backlog   Maximum length of the queue

BGServerSocket::BGServerSocket (long port, long backlog, BGInetAddress bindAddress)

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

Parameters:
port   Port number, or 0 to use any free port
backlog   Maximum length of the queue
bindAddress   Local InetAddress the server will bind to

virtual BGString BGServerSocket::toString () [virtual]

Generates string representation of this object.

This is useful for logging, etc. - This method will replace dump !

Returns:
Stringrepresentation of this object

Reimplemented from BGObject.

virtual unsigned long BGServerSocket::hash () [virtual]

Generates a 'unique' hashvalue of this object.

Note: The returned pointer will point to class buffer. Therefore do not delete it, dupe it if you need it outside of instance lifecycle.

Returns:
Hash of this object

Reimplemented from BGObject.

virtual bool BGServerSocket::equals (BGObject & obj) [virtual]

Returns true, if specified object is equal to own instance.

First we compare class identifier. If both object has same class type, we dispatch to compare method, which should always be able to compare instances with same type.

Parameters:
obj   Object reference to compare with us
Returns:
True, if object is equal to own instance

Reimplemented from BGObject.

virtual BGString BGServerSocket::className () [virtual]

Return the class name for this class.

Subclasses should overwrite this method to return their own name.

Reimplemented from BGObject.

long BGServerSocket::getLocalPort ()

Returns the port on which this socket is listening.

Returns:
The port number to which this socket is listening

BGSocket BGServerSocket::accept ()

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

The method blocks until a connection is made.


The documentation for this class was generated from the following file:
Generated at Fri Feb 18 10:57:07 2000 for bgclass by doxygen 0.49-991205 written by Dimitri van Heesch, © 1997-1999