Package net.i2p.client.streaming.impl
Class StandardSocket
java.lang.Object
java.net.Socket
net.i2p.client.streaming.impl.StandardSocket
- All Implemented Interfaces:
Closeable,AutoCloseable
class StandardSocket extends Socket
Bridge to I2PSocket.
This extends Socket to make porting apps easier.
Methods throw IOExceptions like Sockets do, rather than returning
null for some methods.
StandardSockets are always bound, and always start out connected
(unless connectDelay is > 0).
You may not create an unbound StandardSocket.
Create this through the SocketManager.
Todo: Make public and add getPeerDestination() ?
- Since:
- 0.8.4
- Author:
- zzz
-
Constructor Summary
Constructors Constructor Description StandardSocket(I2PSocket socket) -
Method Summary
Methods inherited from class java.net.Socket
getOption, setOption, setSocketImplFactory, supportedOptions
-
Constructor Details
-
StandardSocket
StandardSocket(I2PSocket socket)
-
-
Method Details
-
bind
- Overrides:
bindin classSocket- Throws:
UnsupportedOperationException- always
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException
-
connect
- Overrides:
connectin classSocket- Throws:
UnsupportedOperationException- always
-
connect
- Overrides:
connectin classSocket- Throws:
UnsupportedOperationException- always
-
getChannel
- Overrides:
getChannelin classSocket- Returns:
- null always, unimplemented
-
getInetAddress
- Overrides:
getInetAddressin classSocket- Returns:
- null always
-
getInputStream
- Overrides:
getInputStreamin classSocket- Throws:
IOException
-
getKeepAlive
public boolean getKeepAlive()- Overrides:
getKeepAlivein classSocket
-
getLocalAddress
- Overrides:
getLocalAddressin classSocket- Returns:
- null always
-
getLocalPort
public int getLocalPort()- Overrides:
getLocalPortin classSocket- Returns:
- the port or 0 if unknown
-
getLocalSocketAddress
- Overrides:
getLocalSocketAddressin classSocket- Returns:
- an I2PSocketAddress as of 0.9.26; prior to that, returned null
- Since:
- implemented in 0.9.26
-
getOOBInline
public boolean getOOBInline()- Overrides:
getOOBInlinein classSocket- Returns:
- false always
-
getOutputStream
- Overrides:
getOutputStreamin classSocket- Throws:
IOException
-
getPort
public int getPort() -
getReceiveBufferSize
public int getReceiveBufferSize()- Overrides:
getReceiveBufferSizein classSocket
-
getRemoteSocketAddress
- Overrides:
getRemoteSocketAddressin classSocket- Returns:
- an I2PSocketAddress as of 0.9.26; prior to that, threw UnsupportedOperationException
- Since:
- implemented in 0.9.26
-
getReuseAddress
public boolean getReuseAddress()- Overrides:
getReuseAddressin classSocket- Returns:
- false always
-
getSendBufferSize
public int getSendBufferSize()- Overrides:
getSendBufferSizein classSocket
-
getSoLinger
public int getSoLinger()- Overrides:
getSoLingerin classSocket
-
getSoTimeout
public int getSoTimeout()- Overrides:
getSoTimeoutin classSocket
-
getTcpNoDelay
public boolean getTcpNoDelay()- Overrides:
getTcpNoDelayin classSocket- Returns:
- false always
-
getTrafficClass
public int getTrafficClass()- Overrides:
getTrafficClassin classSocket- Returns:
- 0 always
-
isBound
public boolean isBound() -
isClosed
public boolean isClosed() -
isConnected
public boolean isConnected()- Overrides:
isConnectedin classSocket
-
isInputShutdown
public boolean isInputShutdown()- Overrides:
isInputShutdownin classSocket
-
isOutputShutdown
public boolean isOutputShutdown()- Overrides:
isOutputShutdownin classSocket
-
sendUrgentData
public void sendUrgentData(int data)- Overrides:
sendUrgentDatain classSocket- Throws:
UnsupportedOperationException- always
-
setKeepAlive
public void setKeepAlive(boolean on)- Overrides:
setKeepAlivein classSocket
-
setOOBInline
public void setOOBInline(boolean on)- Overrides:
setOOBInlinein classSocket- Throws:
UnsupportedOperationException- if on is true
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)Does nothing.- Overrides:
setPerformancePreferencesin classSocket
-
setReceiveBufferSize
public void setReceiveBufferSize(int size)Does nothing.- Overrides:
setReceiveBufferSizein classSocket
-
setReuseAddress
public void setReuseAddress(boolean on)Does nothing.- Overrides:
setReuseAddressin classSocket
-
setSendBufferSize
public void setSendBufferSize(int size)Does nothing.- Overrides:
setSendBufferSizein classSocket
-
setSoLinger
public void setSoLinger(boolean on, int linger)Does nothing.- Overrides:
setSoLingerin classSocket
-
setSoTimeout
- Overrides:
setSoTimeoutin classSocket- Throws:
SocketException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on)Does nothing.- Overrides:
setTcpNoDelayin classSocket
-
setTrafficClass
public void setTrafficClass(int tc)Does nothing.- Overrides:
setTrafficClassin classSocket
-
shutdownInput
- Overrides:
shutdownInputin classSocket- Throws:
IOException
-
shutdownOutput
- Overrides:
shutdownOutputin classSocket- Throws:
IOException
-
toString
-