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 Detail
-
StandardSocket
StandardSocket(I2PSocket socket)
-
-
Method Detail
-
bind
public void bind(SocketAddress bindpoint)
- Overrides:
bindin classSocket- Throws:
UnsupportedOperationException- always
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException
-
connect
public void connect(SocketAddress endpoint)
- Overrides:
connectin classSocket- Throws:
UnsupportedOperationException- always
-
connect
public void connect(SocketAddress endpoint, int timeout)
- Overrides:
connectin classSocket- Throws:
UnsupportedOperationException- always
-
getChannel
public SocketChannel getChannel()
- Overrides:
getChannelin classSocket- Returns:
- null always, unimplemented
-
getInetAddress
public InetAddress getInetAddress()
- Overrides:
getInetAddressin classSocket- Returns:
- null always
-
getInputStream
public InputStream getInputStream() throws IOException
- Overrides:
getInputStreamin classSocket- Throws:
IOException
-
getKeepAlive
public boolean getKeepAlive()
- Overrides:
getKeepAlivein classSocket
-
getLocalAddress
public InetAddress getLocalAddress()
- Overrides:
getLocalAddressin classSocket- Returns:
- null always
-
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPortin classSocket- Returns:
- the port or 0 if unknown
-
getLocalSocketAddress
public SocketAddress 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
public OutputStream getOutputStream() throws IOException
- Overrides:
getOutputStreamin classSocket- Throws:
IOException
-
getReceiveBufferSize
public int getReceiveBufferSize()
- Overrides:
getReceiveBufferSizein classSocket
-
getRemoteSocketAddress
public SocketAddress 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
-
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
public void setSoTimeout(int timeout) throws SocketException- 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
public void shutdownInput() throws IOException- Overrides:
shutdownInputin classSocket- Throws:
IOException
-
shutdownOutput
public void shutdownOutput() throws IOException- Overrides:
shutdownOutputin classSocket- Throws:
IOException
-
-