Package net.i2p.client.streaming.impl
Class StandardServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- net.i2p.client.streaming.impl.StandardServerSocket
-
- All Implemented Interfaces:
Closeable,AutoCloseable
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
Constructors Constructor Description StandardServerSocket(I2PServerSocketFull socket)Doesn't really throw IOE but super() does
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Socketaccept()voidbind(SocketAddress endpoint)voidbind(SocketAddress endpoint, int backlog)voidclose()ServerSocketChannelgetChannel()InetAddressgetInetAddress()intgetLocalPort()SocketAddressgetLocalSocketAddress()Port in returned SocketAddress will be zero.intgetReceiveBufferSize()booleangetReuseAddress()intgetSoTimeout()booleanisBound()booleanisClosed()voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth)Does nothing.voidsetReceiveBufferSize(int size)Does nothing.voidsetReuseAddress(boolean on)Does nothing.voidsetSoTimeout(int timeout)StringtoString()-
Methods inherited from class java.net.ServerSocket
getOption, implAccept, setOption, setSocketFactory, supportedOptions
-
-
-
-
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:
acceptin classServerSocket- Throws:
IOException
-
bind
public void bind(SocketAddress endpoint)
- Overrides:
bindin classServerSocket- Throws:
UnsupportedOperationException- always
-
bind
public void bind(SocketAddress endpoint, int backlog)
- Overrides:
bindin classServerSocket- Throws:
UnsupportedOperationException- always
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classServerSocket- Throws:
IOException
-
getChannel
public ServerSocketChannel getChannel()
- Overrides:
getChannelin classServerSocket- Returns:
- null always, unimplemented
-
getInetAddress
public InetAddress getInetAddress()
- Overrides:
getInetAddressin classServerSocket- Returns:
- null always
-
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPortin classServerSocket- Returns:
- -1 always
-
getLocalSocketAddress
public SocketAddress getLocalSocketAddress()
Port in returned SocketAddress will be zero.- Overrides:
getLocalSocketAddressin classServerSocket- Returns:
- an I2PSocketAddress as of 0.9.26; prior to that, returned null
- Since:
- implemented in 0.9.26
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Overrides:
getReceiveBufferSizein classServerSocket
-
getReuseAddress
public boolean getReuseAddress()
- Overrides:
getReuseAddressin classServerSocket- Returns:
- false always
-
getSoTimeout
public int getSoTimeout()
- Overrides:
getSoTimeoutin classServerSocket
-
isBound
public boolean isBound()
- Overrides:
isBoundin classServerSocket- Returns:
- true always
-
isClosed
public boolean isClosed()
- Overrides:
isClosedin classServerSocket
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)Does nothing.- Overrides:
setPerformancePreferencesin classServerSocket
-
setReceiveBufferSize
public void setReceiveBufferSize(int size)
Does nothing.- Overrides:
setReceiveBufferSizein classServerSocket
-
setReuseAddress
public void setReuseAddress(boolean on)
Does nothing.- Overrides:
setReuseAddressin classServerSocket
-
setSoTimeout
public void setSoTimeout(int timeout) throws SocketException- Overrides:
setSoTimeoutin classServerSocket- Throws:
SocketException
-
toString
public String toString()
- Overrides:
toStringin classServerSocket
-
-