net.i2p.client.streaming
Class StandardServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by net.i2p.client.streaming.StandardServerSocket

 class StandardServerSocket
extends ServerSocket

Bridge to I2PServerSocket. This extends ServerSocket to make porting apps easier. accept() returns a real Socket (a StandardSocket). accept() throws IOExceptions like ServerSockets do, rather than returning null or throwing I2PExceptions. StandardServerSockets are always bound. You may not create an unbound StandardServerSocket. Create this through the SocketManager.

Since:
0.8.4
Author:
zzz

Constructor Summary
StandardServerSocket(I2PServerSocketFull socket)
          Doesn't really throw IOE but super() does
 
Method Summary
 Socket accept()
           
 void bind(SocketAddress endpoint)
           
 void bind(SocketAddress endpoint, int backlog)
           
 void close()
           
 ServerSocketChannel getChannel()
           
 InetAddress getInetAddress()
           
 int getLocalPort()
           
 SocketAddress getLocalSocketAddress()
           
 int getReceiveBufferSize()
           
 boolean getReuseAddress()
           
 int getSoTimeout()
           
 boolean isBound()
           
 boolean isClosed()
           
 void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
          Does nothing.
 void setReceiveBufferSize(int size)
          Does nothing.
 void setReuseAddress(boolean on)
          Does nothing.
 void setSoTimeout(int timeout)
           
 String toString()
           
 
Methods inherited from class java.net.ServerSocket
implAccept, setSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardServerSocket

StandardServerSocket(I2PServerSocketFull socket)
               throws IOException
Doesn't really throw IOE but super() does

Throws:
IOException
Method Detail

accept

public Socket accept()
              throws IOException
Overrides:
accept in class ServerSocket
Throws:
IOException

bind

public void bind(SocketAddress endpoint)
Overrides:
bind in class ServerSocket
Throws:
UnsupportedOperationException - always

bind

public void bind(SocketAddress endpoint,
                 int backlog)
Overrides:
bind in class ServerSocket
Throws:
UnsupportedOperationException - always

close

public void close()
           throws IOException
Overrides:
close in class ServerSocket
Throws:
IOException

getChannel

public ServerSocketChannel getChannel()
Overrides:
getChannel in class ServerSocket
Returns:
null always, see AcceptingChannelImpl for more info

getInetAddress

public InetAddress getInetAddress()
Overrides:
getInetAddress in class ServerSocket
Returns:
null always

getLocalPort

public int getLocalPort()
Overrides:
getLocalPort in class ServerSocket
Returns:
-1 always

getLocalSocketAddress

public SocketAddress getLocalSocketAddress()
Overrides:
getLocalSocketAddress in class ServerSocket
Returns:
null always

getReceiveBufferSize

public int getReceiveBufferSize()
Overrides:
getReceiveBufferSize in class ServerSocket

getReuseAddress

public boolean getReuseAddress()
Overrides:
getReuseAddress in class ServerSocket
Returns:
false always

getSoTimeout

public int getSoTimeout()
Overrides:
getSoTimeout in class ServerSocket

isBound

public boolean isBound()
Overrides:
isBound in class ServerSocket
Returns:
true always

isClosed

public boolean isClosed()
Overrides:
isClosed in class ServerSocket

setPerformancePreferences

public void setPerformancePreferences(int connectionTime,
                                      int latency,
                                      int bandwidth)
Does nothing.

Overrides:
setPerformancePreferences in class ServerSocket

setReceiveBufferSize

public void setReceiveBufferSize(int size)
Does nothing.

Overrides:
setReceiveBufferSize in class ServerSocket

setReuseAddress

public void setReuseAddress(boolean on)
Does nothing.

Overrides:
setReuseAddress in class ServerSocket

setSoTimeout

public void setSoTimeout(int timeout)
                  throws SocketException
Overrides:
setSoTimeout in class ServerSocket
Throws:
SocketException

toString

public String toString()
Overrides:
toString in class ServerSocket