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
ConstructorsConstructorDescriptionDoesn't really throw IOE but super() does -
Method Summary
Modifier and TypeMethodDescriptionaccept()voidbind(SocketAddress endpoint) voidbind(SocketAddress endpoint, int backlog) voidclose()intPort in returned SocketAddress will be zero.intbooleanintbooleanisBound()booleanisClosed()voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth) Does nothing.voidsetReceiveBufferSize(int size) Does nothing.voidsetReuseAddress(boolean on) Does nothing.voidsetSoTimeout(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:
acceptin classServerSocket- Throws:
IOException
-
bind
- Overrides:
bindin classServerSocket- Throws:
UnsupportedOperationException- always
-
bind
- Overrides:
bindin classServerSocket- Throws:
UnsupportedOperationException- always
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classServerSocket- Throws:
IOException
-
getChannel
- Overrides:
getChannelin classServerSocket- Returns:
- null always, unimplemented
-
getInetAddress
- Overrides:
getInetAddressin classServerSocket- Returns:
- null always
-
getLocalPort
public int getLocalPort()- Overrides:
getLocalPortin classServerSocket- Returns:
- -1 always
-
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
- Overrides:
setSoTimeoutin classServerSocket- Throws:
SocketException
-
toString
- Overrides:
toStringin classServerSocket
-