Class ClientSocketFactory.SocketWrapper
java.lang.Object
java.net.Socket
ecmwf.common.rmi.ClientSocketFactory.SocketWrapper
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
ClientSocketFactory
The Class SocketWrapper.
-
Constructor Summary
ConstructorsConstructorDescriptionSocketWrapper
(ClientSocketStatistics statistics, Socket socket) Instantiates a new socket wrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close.Gets the channel.Gets the inet address.Gets the input stream.boolean
Gets the keep alive.Gets the local address.int
Gets the local port.Gets the local socket address.boolean
Gets the OOB inline.Gets the output stream.int
getPort()
Gets the port.int
Gets the receive buffer size.Gets the remote socket address.boolean
Gets the reuse address.int
Gets the send buffer size.int
Gets the so linger.int
Gets the so timeout.boolean
Gets the tcp no delay.int
Gets the traffic class.boolean
isBound()
Checks if is bound.boolean
isClosed()
Checks if is closed.boolean
Checks if is connected.boolean
Checks if is input shutdown.boolean
Checks if is output shutdown.void
sendUrgentData
(int data) Send urgent data.void
setKeepAlive
(boolean on) Sets the keep alive.void
setOOBInline
(boolean on) Sets the OOB inline.void
setPerformancePreferences
(int connectionTime, int latency, int bandwidth) Sets the performance preferences.void
setReceiveBufferSize
(int size) Sets the receive buffer size.void
setReuseAddress
(boolean on) Sets the reuse address.void
setSendBufferSize
(int size) Sets the send buffer size.void
setSoLinger
(boolean on, int linger) Sets the so linger.void
setSoTimeout
(int timeout) Sets the so timeout.void
setTcpNoDelay
(boolean on) Sets the tcp no delay.void
setTrafficClass
(int tc) Sets the traffic class.void
Shutdown input.void
Shutdown output.toString()
To string.void
Update statistics.Methods inherited from class java.net.Socket
bind, connect, connect, getOption, setOption, setSocketImplFactory, supportedOptions
-
Constructor Details
-
SocketWrapper
Instantiates a new socket wrapper.- Parameters:
statistics
- the statisticssocket
- the socket
-
-
Method Details
-
updateStatistics
Update statistics.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
close
Close.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classSocket
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getChannel
Gets the channel.- Overrides:
getChannel
in classSocket
- Returns:
- the channel
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddress
in classSocket
- Returns:
- the inet address
-
getInputStream
Gets the input stream.- Overrides:
getInputStream
in classSocket
- Returns:
- the input stream
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getKeepAlive
Gets the keep alive.- Overrides:
getKeepAlive
in classSocket
- Returns:
- the keep alive
- Throws:
SocketException
- the socket exception
-
getLocalAddress
Gets the local address.- Overrides:
getLocalAddress
in classSocket
- Returns:
- the local address
-
getLocalPort
public int getLocalPort()Gets the local port.- Overrides:
getLocalPort
in classSocket
- Returns:
- the local port
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddress
in classSocket
- Returns:
- the local socket address
-
getOOBInline
Gets the OOB inline.- Overrides:
getOOBInline
in classSocket
- Returns:
- the OOB inline
- Throws:
SocketException
- the socket exception
-
getOutputStream
Gets the output stream.- Overrides:
getOutputStream
in classSocket
- Returns:
- the output stream
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getPort
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSize
in classSocket
- Returns:
- the receive buffer size
- Throws:
SocketException
- the socket exception
-
getRemoteSocketAddress
Gets the remote socket address.- Overrides:
getRemoteSocketAddress
in classSocket
- Returns:
- the remote socket address
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddress
in classSocket
- Returns:
- the reuse address
- Throws:
SocketException
- the socket exception
-
getSendBufferSize
Gets the send buffer size.- Overrides:
getSendBufferSize
in classSocket
- Returns:
- the send buffer size
- Throws:
SocketException
- the socket exception
-
getSoLinger
Gets the so linger.- Overrides:
getSoLinger
in classSocket
- Returns:
- the so linger
- Throws:
SocketException
- the socket exception
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeout
in classSocket
- Returns:
- the so timeout
- Throws:
SocketException
- the socket exception
-
getTcpNoDelay
Gets the tcp no delay.- Overrides:
getTcpNoDelay
in classSocket
- Returns:
- the tcp no delay
- Throws:
SocketException
- the socket exception
-
getTrafficClass
Gets the traffic class.- Overrides:
getTrafficClass
in classSocket
- Returns:
- the traffic class
- Throws:
SocketException
- the socket exception
-
isBound
-
isClosed
-
isConnected
public boolean isConnected()Checks if is connected.- Overrides:
isConnected
in classSocket
- Returns:
- true, if is connected
-
isInputShutdown
public boolean isInputShutdown()Checks if is input shutdown.- Overrides:
isInputShutdown
in classSocket
- Returns:
- true, if is input shutdown
-
isOutputShutdown
public boolean isOutputShutdown()Checks if is output shutdown.- Overrides:
isOutputShutdown
in classSocket
- Returns:
- true, if is output shutdown
-
sendUrgentData
Send urgent data.- Overrides:
sendUrgentData
in classSocket
- Parameters:
data
- the data- Throws:
IOException
- Signals that an I/O exception has occurred.
-
setKeepAlive
Sets the keep alive.- Overrides:
setKeepAlive
in classSocket
- Parameters:
on
- the new keep alive- Throws:
SocketException
- the socket exception
-
setOOBInline
Sets the OOB inline.- Overrides:
setOOBInline
in classSocket
- Parameters:
on
- the new OOB inline- Throws:
SocketException
- the socket exception
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets the performance preferences.- Overrides:
setPerformancePreferences
in classSocket
- Parameters:
connectionTime
- the connection timelatency
- the latencybandwidth
- the bandwidth
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSize
in classSocket
- Parameters:
size
- the new receive buffer size- Throws:
SocketException
- the socket exception
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddress
in classSocket
- Parameters:
on
- the new reuse address- Throws:
SocketException
- the socket exception
-
setSendBufferSize
Sets the send buffer size.- Overrides:
setSendBufferSize
in classSocket
- Parameters:
size
- the new send buffer size- Throws:
SocketException
- the socket exception
-
setSoLinger
Sets the so linger.- Overrides:
setSoLinger
in classSocket
- Parameters:
on
- the onlinger
- the linger- Throws:
SocketException
- the socket exception
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeout
in classSocket
- Parameters:
timeout
- the new so timeout- Throws:
SocketException
- the socket exception
-
setTcpNoDelay
Sets the tcp no delay.- Overrides:
setTcpNoDelay
in classSocket
- Parameters:
on
- the new tcp no delay- Throws:
SocketException
- the socket exception
-
setTrafficClass
Sets the traffic class.- Overrides:
setTrafficClass
in classSocket
- Parameters:
tc
- the new traffic class- Throws:
SocketException
- the socket exception
-
shutdownInput
Shutdown input.- Overrides:
shutdownInput
in classSocket
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
shutdownOutput
Shutdown output.- Overrides:
shutdownOutput
in classSocket
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
toString
-