equip.net
Class ServerSap

java.lang.Object
  extended byequip.net.ServerSap
Direct Known Subclasses:
ServerSapTcp, ServerSapUdp

public abstract class ServerSap
extends java.lang.Object

The abstract class/interface for a Server SAP (Service Access Point), e.g. a TCP ServerSocket.


Field Summary
protected  int address
          Socket IPv4 host address
protected  short port
          Socket UDP/TCP port
protected  int status
          Socket status cache
 
Constructor Summary
protected ServerSap()
          Default constructor, only accessible to subclass
 
Method Summary
abstract  ConnectionSap accept()
          Accept an incoming connection, normally blocking
abstract  void close()
          Close the server socket (no more connections)
 int getAddress()
          Get server IP address, currently IPv4 as 32bit int
 short getPort()
          Get server socket UDP/TCP port number
abstract  int getProtocol()
          What protocol (from SapProtocol)
 int getStatus()
          Current status; cached in field status
static java.net.InetAddress rewriteLocalAddress(java.net.InetAddress addr)
          chance to replace local socket ip address with something else, e.g. to deal with multi-home issues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

protected int address
Socket IPv4 host address


port

protected short port
Socket UDP/TCP port


status

protected int status
Socket status cache

Constructor Detail

ServerSap

protected ServerSap()
Default constructor, only accessible to subclass

Method Detail

getPort

public short getPort()
Get server socket UDP/TCP port number


getAddress

public int getAddress()
Get server IP address, currently IPv4 as 32bit int


getProtocol

public abstract int getProtocol()
What protocol (from SapProtocol)


getStatus

public int getStatus()
Current status; cached in field status


accept

public abstract ConnectionSap accept()
Accept an incoming connection, normally blocking


close

public abstract void close()
Close the server socket (no more connections)


rewriteLocalAddress

public static java.net.InetAddress rewriteLocalAddress(java.net.InetAddress addr)
chance to replace local socket ip address with something else, e.g. to deal with multi-home issues