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 TypeMethodDescriptionvoidclose()Close.Gets the channel.Gets the inet address.Gets the input stream.booleanGets the keep alive.Gets the local address.intGets the local port.Gets the local socket address.booleanGets the OOB inline.Gets the output stream.intgetPort()Gets the port.intGets the receive buffer size.Gets the remote socket address.booleanGets the reuse address.intGets the send buffer size.intGets the so linger.intGets the so timeout.booleanGets the tcp no delay.intGets the traffic class.booleanisBound()Checks if is bound.booleanisClosed()Checks if is closed.booleanChecks if is connected.booleanChecks if is input shutdown.booleanChecks if is output shutdown.voidsendUrgentData(int data) Send urgent data.voidsetKeepAlive(boolean on) Sets the keep alive.voidsetOOBInline(boolean on) Sets the OOB inline.voidsetPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets the performance preferences.voidsetReceiveBufferSize(int size) Sets the receive buffer size.voidsetReuseAddress(boolean on) Sets the reuse address.voidsetSendBufferSize(int size) Sets the send buffer size.voidsetSoLinger(boolean on, int linger) Sets the so linger.voidsetSoTimeout(int timeout) Sets the so timeout.voidsetTcpNoDelay(boolean on) Sets the tcp no delay.voidsetTrafficClass(int tc) Sets the traffic class.voidShutdown input.voidShutdown output.toString()To string.voidUpdate 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException- Signals that an I/O exception has occurred.
-
getChannel
Gets the channel.- Overrides:
getChannelin classSocket- Returns:
- the channel
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddressin classSocket- Returns:
- the inet address
-
getInputStream
Gets the input stream.- Overrides:
getInputStreamin classSocket- Returns:
- the input stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getKeepAlive
Gets the keep alive.- Overrides:
getKeepAlivein classSocket- Returns:
- the keep alive
- Throws:
SocketException- the socket exception
-
getLocalAddress
Gets the local address.- Overrides:
getLocalAddressin classSocket- Returns:
- the local address
-
getLocalPort
public int getLocalPort()Gets the local port.- Overrides:
getLocalPortin classSocket- Returns:
- the local port
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddressin classSocket- Returns:
- the local socket address
-
getOOBInline
Gets the OOB inline.- Overrides:
getOOBInlinein classSocket- Returns:
- the OOB inline
- Throws:
SocketException- the socket exception
-
getOutputStream
Gets the output stream.- Overrides:
getOutputStreamin classSocket- Returns:
- the output stream
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getPort
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSizein classSocket- Returns:
- the receive buffer size
- Throws:
SocketException- the socket exception
-
getRemoteSocketAddress
Gets the remote socket address.- Overrides:
getRemoteSocketAddressin classSocket- Returns:
- the remote socket address
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddressin classSocket- Returns:
- the reuse address
- Throws:
SocketException- the socket exception
-
getSendBufferSize
Gets the send buffer size.- Overrides:
getSendBufferSizein classSocket- Returns:
- the send buffer size
- Throws:
SocketException- the socket exception
-
getSoLinger
Gets the so linger.- Overrides:
getSoLingerin classSocket- Returns:
- the so linger
- Throws:
SocketException- the socket exception
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeoutin classSocket- Returns:
- the so timeout
- Throws:
SocketException- the socket exception
-
getTcpNoDelay
Gets the tcp no delay.- Overrides:
getTcpNoDelayin classSocket- Returns:
- the tcp no delay
- Throws:
SocketException- the socket exception
-
getTrafficClass
Gets the traffic class.- Overrides:
getTrafficClassin classSocket- Returns:
- the traffic class
- Throws:
SocketException- the socket exception
-
isBound
-
isClosed
-
isConnected
public boolean isConnected()Checks if is connected.- Overrides:
isConnectedin classSocket- Returns:
- true, if is connected
-
isInputShutdown
public boolean isInputShutdown()Checks if is input shutdown.- Overrides:
isInputShutdownin classSocket- Returns:
- true, if is input shutdown
-
isOutputShutdown
public boolean isOutputShutdown()Checks if is output shutdown.- Overrides:
isOutputShutdownin classSocket- Returns:
- true, if is output shutdown
-
sendUrgentData
Send urgent data.- Overrides:
sendUrgentDatain classSocket- Parameters:
data- the data- Throws:
IOException- Signals that an I/O exception has occurred.
-
setKeepAlive
Sets the keep alive.- Overrides:
setKeepAlivein classSocket- Parameters:
on- the new keep alive- Throws:
SocketException- the socket exception
-
setOOBInline
Sets the OOB inline.- Overrides:
setOOBInlinein 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:
setPerformancePreferencesin classSocket- Parameters:
connectionTime- the connection timelatency- the latencybandwidth- the bandwidth
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSizein classSocket- Parameters:
size- the new receive buffer size- Throws:
SocketException- the socket exception
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddressin classSocket- Parameters:
on- the new reuse address- Throws:
SocketException- the socket exception
-
setSendBufferSize
Sets the send buffer size.- Overrides:
setSendBufferSizein classSocket- Parameters:
size- the new send buffer size- Throws:
SocketException- the socket exception
-
setSoLinger
Sets the so linger.- Overrides:
setSoLingerin classSocket- Parameters:
on- the onlinger- the linger- Throws:
SocketException- the socket exception
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeoutin classSocket- Parameters:
timeout- the new so timeout- Throws:
SocketException- the socket exception
-
setTcpNoDelay
Sets the tcp no delay.- Overrides:
setTcpNoDelayin classSocket- Parameters:
on- the new tcp no delay- Throws:
SocketException- the socket exception
-
setTrafficClass
Sets the traffic class.- Overrides:
setTrafficClassin classSocket- Parameters:
tc- the new traffic class- Throws:
SocketException- the socket exception
-
shutdownInput
Shutdown input.- Overrides:
shutdownInputin classSocket- Throws:
IOException- Signals that an I/O exception has occurred.
-
shutdownOutput
Shutdown output.- Overrides:
shutdownOutputin classSocket- Throws:
IOException- Signals that an I/O exception has occurred.
-
toString
-