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
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
ConstructorDescriptionDoesn't really throw IOE but super() does -
Method Summary
Modifier and TypeMethodDescriptionaccept()
void
bind
(SocketAddress endpoint) void
bind
(SocketAddress endpoint, int backlog) void
close()
int
Port in returned SocketAddress will be zero.int
boolean
int
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) toString()
Methods inherited from class java.net.ServerSocket
getOption, implAccept, setOption, setSocketFactory, supportedOptions
-
Constructor Details
-
StandardServerSocket
StandardServerSocket(I2PServerSocketFull socket) throws IOException Doesn't really throw IOE but super() does- Throws:
IOException
-
-
Method Details
-
accept
- Overrides:
accept
in classServerSocket
- Throws:
IOException
-
bind
- Overrides:
bind
in classServerSocket
- Throws:
UnsupportedOperationException
- always
-
bind
- Overrides:
bind
in classServerSocket
- Throws:
UnsupportedOperationException
- always
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classServerSocket
- Throws:
IOException
-
getChannel
- Overrides:
getChannel
in classServerSocket
- Returns:
- null always, unimplemented
-
getInetAddress
- Overrides:
getInetAddress
in classServerSocket
- Returns:
- null always
-
getLocalPort
public int getLocalPort()- Overrides:
getLocalPort
in classServerSocket
- Returns:
- -1 always
-
getLocalSocketAddress
Port in returned SocketAddress will be zero.- Overrides:
getLocalSocketAddress
in 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:
getReceiveBufferSize
in classServerSocket
-
getReuseAddress
public boolean getReuseAddress()- Overrides:
getReuseAddress
in classServerSocket
- Returns:
- false always
-
getSoTimeout
public int getSoTimeout()- Overrides:
getSoTimeout
in classServerSocket
-
isBound
public boolean isBound()- Overrides:
isBound
in classServerSocket
- Returns:
- true always
-
isClosed
public boolean isClosed()- Overrides:
isClosed
in classServerSocket
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Does nothing.- Overrides:
setPerformancePreferences
in classServerSocket
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) Does nothing.- Overrides:
setReceiveBufferSize
in classServerSocket
-
setReuseAddress
public void setReuseAddress(boolean on) Does nothing.- Overrides:
setReuseAddress
in classServerSocket
-
setSoTimeout
- Overrides:
setSoTimeout
in classServerSocket
- Throws:
SocketException
-
toString
- Overrides:
toString
in classServerSocket
-