edu.emory.mathcs.util.net.inproc
Class InProcServerSocket

java.lang.Object
  extended byjava.net.ServerSocket
      extended byedu.emory.mathcs.util.net.inproc.InProcServerSocket

public abstract class InProcServerSocket
extends java.net.ServerSocket

Abstraction of a server socket which can be accessed only from within a process. While this class fully adheres to the socket API, it is a server socket that accepts connections only from appropriate "sockets" within the same process. The class can be used to create local in-process bindings within APIs that assume remote access. For instance, when used as an RMI transport, in-process sockets can interconnect local objects while maintaining remote invocation semantics (pass-by-value etc.) yet avoiding security risks associated with network sockets and offering a bit better performance than a loopback network interface.

Version:
1.0
Author:
Dawid Kurzyniec
See Also:
InProcSocket

Constructor Summary
InProcServerSocket()
           
InProcServerSocket(InProcSocketAddress addr)
           
InProcServerSocket(InProcSocketAddress addr, int backlog)
           
InProcServerSocket(int port)
           
InProcServerSocket(int port, int backlog)
           
 
Method Summary
 java.net.Socket accept()
           
 void bind(java.net.SocketAddress endpoint, int backlog)
           
 void close()
           
 java.net.InetAddress getInetAddress()
           
 int getLocalPort()
           
 java.net.SocketAddress getLocalSocketAddress()
           
 boolean getReuseAddress()
           
 int getSoTimeout()
           
 boolean isBound()
           
 boolean isClosed()
           
 void setReuseAddress(boolean on)
           
 void setSoTimeout(int timeout)
           
 java.lang.String toString()
           
 
Methods inherited from class java.net.ServerSocket
bind, getChannel, getReceiveBufferSize, implAccept, setReceiveBufferSize, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InProcServerSocket

public InProcServerSocket()
                   throws java.io.IOException

InProcServerSocket

public InProcServerSocket(int port)
                   throws java.io.IOException

InProcServerSocket

public InProcServerSocket(int port,
                          int backlog)
                   throws java.io.IOException

InProcServerSocket

public InProcServerSocket(InProcSocketAddress addr)
                   throws java.io.IOException

InProcServerSocket

public InProcServerSocket(InProcSocketAddress addr,
                          int backlog)
                   throws java.io.IOException
Method Detail

bind

public void bind(java.net.SocketAddress endpoint,
                 int backlog)
          throws java.io.IOException
Throws:
java.io.IOException

isClosed

public boolean isClosed()

isBound

public boolean isBound()

getInetAddress

public java.net.InetAddress getInetAddress()

getLocalPort

public int getLocalPort()

getLocalSocketAddress

public java.net.SocketAddress getLocalSocketAddress()

accept

public java.net.Socket accept()
                       throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

setSoTimeout

public void setSoTimeout(int timeout)
                  throws java.net.SocketException
Throws:
java.net.SocketException

getSoTimeout

public int getSoTimeout()
                 throws java.io.IOException
Throws:
java.io.IOException

setReuseAddress

public void setReuseAddress(boolean on)
                     throws java.net.SocketException
Throws:
java.net.SocketException

getReuseAddress

public boolean getReuseAddress()
                        throws java.net.SocketException
Throws:
java.net.SocketException

toString

public java.lang.String toString()