Class MonitoredSocket
java.lang.Object
java.net.Socket
ecmwf.common.technical.MonitoredSocket
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new monitored socket.MonitoredSocket
(Socket decoratee) Instantiates a new monitored socket. -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(SocketAddress bindpoint) Bind.void
close()
Close.void
connect
(SocketAddress endpoint) Connect.void
connect
(SocketAddress endpoint, int timeout) Connect.boolean
Equals.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.int
hashCode()
Hash code.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.Methods inherited from class java.net.Socket
getOption, setOption, setSocketImplFactory, supportedOptions
-
Field Details
-
decoratee
The decoratee.
-
-
Constructor Details
-
MonitoredSocket
public MonitoredSocket()Instantiates a new monitored socket. -
MonitoredSocket
Instantiates a new monitored socket.- Parameters:
decoratee
- the decoratee
-
-
Method Details
-
bind
Bind.- Overrides:
bind
in classSocket
- Throws:
IOException
-
close
Close.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classSocket
- Throws:
IOException
-
connect
Connect.- Overrides:
connect
in classSocket
- Throws:
IOException
-
connect
Connect.- Overrides:
connect
in classSocket
- Throws:
IOException
-
equals
-
getChannel
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddress
in classSocket
-
getInputStream
Gets the input stream.- Overrides:
getInputStream
in classSocket
- Throws:
IOException
-
getKeepAlive
Gets the keep alive.- Overrides:
getKeepAlive
in classSocket
- Throws:
SocketException
-
getLocalAddress
Gets the local address.- Overrides:
getLocalAddress
in classSocket
-
getLocalPort
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddress
in classSocket
-
getOOBInline
Gets the OOB inline.- Overrides:
getOOBInline
in classSocket
- Throws:
SocketException
-
getOutputStream
Gets the output stream.- Overrides:
getOutputStream
in classSocket
- Throws:
IOException
-
getPort
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSize
in classSocket
- Throws:
SocketException
-
getRemoteSocketAddress
Gets the remote socket address.- Overrides:
getRemoteSocketAddress
in classSocket
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddress
in classSocket
- Throws:
SocketException
-
getSendBufferSize
Gets the send buffer size.- Overrides:
getSendBufferSize
in classSocket
- Throws:
SocketException
-
getSoLinger
Gets the so linger.- Overrides:
getSoLinger
in classSocket
- Throws:
SocketException
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeout
in classSocket
- Throws:
SocketException
-
getTcpNoDelay
Gets the tcp no delay.- Overrides:
getTcpNoDelay
in classSocket
- Throws:
SocketException
-
getTrafficClass
Gets the traffic class.- Overrides:
getTrafficClass
in classSocket
- Throws:
SocketException
-
hashCode
-
isBound
-
isClosed
-
isConnected
-
isInputShutdown
public boolean isInputShutdown()Checks if is input shutdown.- Overrides:
isInputShutdown
in classSocket
-
isOutputShutdown
public boolean isOutputShutdown()Checks if is output shutdown.- Overrides:
isOutputShutdown
in classSocket
-
sendUrgentData
Send urgent data.- Overrides:
sendUrgentData
in classSocket
- Throws:
IOException
-
setKeepAlive
Sets the keep alive.- Overrides:
setKeepAlive
in classSocket
- Throws:
SocketException
-
setOOBInline
Sets the OOB inline.- Overrides:
setOOBInline
in classSocket
- Throws:
SocketException
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets the performance preferences.- Overrides:
setPerformancePreferences
in classSocket
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSize
in classSocket
- Throws:
SocketException
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddress
in classSocket
- Throws:
SocketException
-
setSendBufferSize
Sets the send buffer size.- Overrides:
setSendBufferSize
in classSocket
- Throws:
SocketException
-
setSoLinger
Sets the so linger.- Overrides:
setSoLinger
in classSocket
- Throws:
SocketException
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeout
in classSocket
- Throws:
SocketException
-
setTcpNoDelay
Sets the tcp no delay.- Overrides:
setTcpNoDelay
in classSocket
- Throws:
SocketException
-
setTrafficClass
Sets the traffic class.- Overrides:
setTrafficClass
in classSocket
- Throws:
SocketException
-
shutdownInput
Shutdown input.- Overrides:
shutdownInput
in classSocket
- Throws:
IOException
-
shutdownOutput
Shutdown output.- Overrides:
shutdownOutput
in classSocket
- Throws:
IOException
-
toString
-