#include <bgsocket.h>
Class diagram for BGServerSocket:
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. |
BGServerSocket::BGServerSocket (long port) |
Creates a server socket on a specified port.
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.
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.
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 !
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.
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.
obj | Object reference to compare with us |
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.
BGSocket BGServerSocket::accept () |
Listen for a connection to be made to this socket and accepts it.
The method blocks until a connection is made.