Package org.jboss.net.sockets
Class TimeoutSocket
- java.lang.Object
-
- java.net.Socket
-
- org.jboss.net.sockets.TimeoutSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class TimeoutSocket extends java.net.SocketA Socket that overrides the getInputStream to return a InterruptableInputStream- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.Sockets
-
Constructor Summary
Constructors Constructor Description TimeoutSocket(java.net.Socket s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.nio.channels.SocketChannelgetChannel()java.net.InetAddressgetInetAddress()java.io.InputStreamgetInputStream()booleangetKeepAlive()java.net.InetAddressgetLocalAddress()intgetLocalPort()java.net.SocketAddressgetLocalSocketAddress()booleangetOOBInline()java.io.OutputStreamgetOutputStream()intgetPort()intgetReceiveBufferSize()java.net.SocketAddressgetRemoteSocketAddress()booleangetReuseAddress()intgetSendBufferSize()intgetSoLinger()intgetSoTimeout()booleangetTcpNoDelay()intgetTrafficClass()booleanisBound()booleanisClosed()booleanisConnected()booleanisInputShutdown()booleanisOutputShutdown()voidsendUrgentData(int data)voidsetKeepAlive(boolean on)voidsetOOBInline(boolean on)voidsetReceiveBufferSize(int size)voidsetReuseAddress(boolean on)voidsetSendBufferSize(int size)voidsetSoLinger(boolean on, int linger)voidsetSoTimeout(int timeout)voidsetTcpNoDelay(boolean on)voidsetTrafficClass(int tc)voidshutdownInput()voidshutdownOutput()java.lang.StringtoString()
-
-
-
Method Detail
-
getInetAddress
public java.net.InetAddress getInetAddress()
- Overrides:
getInetAddressin classjava.net.Socket
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
- Overrides:
getLocalAddressin classjava.net.Socket
-
getPort
public int getPort()
- Overrides:
getPortin classjava.net.Socket
-
getLocalPort
public int getLocalPort()
- Overrides:
getLocalPortin classjava.net.Socket
-
getRemoteSocketAddress
public java.net.SocketAddress getRemoteSocketAddress()
- Overrides:
getRemoteSocketAddressin classjava.net.Socket
-
getLocalSocketAddress
public java.net.SocketAddress getLocalSocketAddress()
- Overrides:
getLocalSocketAddressin classjava.net.Socket
-
getChannel
public java.nio.channels.SocketChannel getChannel()
- Overrides:
getChannelin classjava.net.Socket
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Overrides:
getInputStreamin classjava.net.Socket- Throws:
java.io.IOException
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException- Overrides:
getOutputStreamin classjava.net.Socket- Throws:
java.io.IOException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) throws java.net.SocketException- Overrides:
setTcpNoDelayin classjava.net.Socket- Throws:
java.net.SocketException
-
getTcpNoDelay
public boolean getTcpNoDelay() throws java.net.SocketException- Overrides:
getTcpNoDelayin classjava.net.Socket- Throws:
java.net.SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger) throws java.net.SocketException- Overrides:
setSoLingerin classjava.net.Socket- Throws:
java.net.SocketException
-
getSoLinger
public int getSoLinger() throws java.net.SocketException- Overrides:
getSoLingerin classjava.net.Socket- Throws:
java.net.SocketException
-
sendUrgentData
public void sendUrgentData(int data) throws java.io.IOException- Overrides:
sendUrgentDatain classjava.net.Socket- Throws:
java.io.IOException
-
setOOBInline
public void setOOBInline(boolean on) throws java.net.SocketException- Overrides:
setOOBInlinein classjava.net.Socket- Throws:
java.net.SocketException
-
getOOBInline
public boolean getOOBInline() throws java.net.SocketException- Overrides:
getOOBInlinein classjava.net.Socket- Throws:
java.net.SocketException
-
setSoTimeout
public void setSoTimeout(int timeout) throws java.net.SocketException- Overrides:
setSoTimeoutin classjava.net.Socket- Throws:
java.net.SocketException
-
getSoTimeout
public int getSoTimeout() throws java.net.SocketException- Overrides:
getSoTimeoutin classjava.net.Socket- Throws:
java.net.SocketException
-
setSendBufferSize
public void setSendBufferSize(int size) throws java.net.SocketException- Overrides:
setSendBufferSizein classjava.net.Socket- Throws:
java.net.SocketException
-
getSendBufferSize
public int getSendBufferSize() throws java.net.SocketException- Overrides:
getSendBufferSizein classjava.net.Socket- Throws:
java.net.SocketException
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) throws java.net.SocketException- Overrides:
setReceiveBufferSizein classjava.net.Socket- Throws:
java.net.SocketException
-
getReceiveBufferSize
public int getReceiveBufferSize() throws java.net.SocketException- Overrides:
getReceiveBufferSizein classjava.net.Socket- Throws:
java.net.SocketException
-
setKeepAlive
public void setKeepAlive(boolean on) throws java.net.SocketException- Overrides:
setKeepAlivein classjava.net.Socket- Throws:
java.net.SocketException
-
getKeepAlive
public boolean getKeepAlive() throws java.net.SocketException- Overrides:
getKeepAlivein classjava.net.Socket- Throws:
java.net.SocketException
-
setTrafficClass
public void setTrafficClass(int tc) throws java.net.SocketException- Overrides:
setTrafficClassin classjava.net.Socket- Throws:
java.net.SocketException
-
getTrafficClass
public int getTrafficClass() throws java.net.SocketException- Overrides:
getTrafficClassin classjava.net.Socket- Throws:
java.net.SocketException
-
setReuseAddress
public void setReuseAddress(boolean on) throws java.net.SocketException- Overrides:
setReuseAddressin classjava.net.Socket- Throws:
java.net.SocketException
-
getReuseAddress
public boolean getReuseAddress() throws java.net.SocketException- Overrides:
getReuseAddressin classjava.net.Socket- Throws:
java.net.SocketException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.net.Socket- Throws:
java.io.IOException
-
shutdownInput
public void shutdownInput() throws java.io.IOException- Overrides:
shutdownInputin classjava.net.Socket- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException- Overrides:
shutdownOutputin classjava.net.Socket- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.net.Socket
-
isConnected
public boolean isConnected()
- Overrides:
isConnectedin classjava.net.Socket
-
isBound
public boolean isBound()
- Overrides:
isBoundin classjava.net.Socket
-
isClosed
public boolean isClosed()
- Overrides:
isClosedin classjava.net.Socket
-
isInputShutdown
public boolean isInputShutdown()
- Overrides:
isInputShutdownin classjava.net.Socket
-
isOutputShutdown
public boolean isOutputShutdown()
- Overrides:
isOutputShutdownin classjava.net.Socket
-
-