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 TypeMethodDescriptionvoidbind(SocketAddress bindpoint) Bind.voidclose()Close.voidconnect(SocketAddress endpoint) Connect.voidconnect(SocketAddress endpoint, int timeout) Connect.booleanEquals.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.inthashCode()Hash code.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.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:
bindin classSocket- Throws:
IOException
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException
-
connect
Connect.- Overrides:
connectin classSocket- Throws:
IOException
-
connect
Connect.- Overrides:
connectin classSocket- Throws:
IOException
-
equals
-
getChannel
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddressin classSocket
-
getInputStream
Gets the input stream.- Overrides:
getInputStreamin classSocket- Throws:
IOException
-
getKeepAlive
Gets the keep alive.- Overrides:
getKeepAlivein classSocket- Throws:
SocketException
-
getLocalAddress
Gets the local address.- Overrides:
getLocalAddressin classSocket
-
getLocalPort
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddressin classSocket
-
getOOBInline
Gets the OOB inline.- Overrides:
getOOBInlinein classSocket- Throws:
SocketException
-
getOutputStream
Gets the output stream.- Overrides:
getOutputStreamin classSocket- Throws:
IOException
-
getPort
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSizein classSocket- Throws:
SocketException
-
getRemoteSocketAddress
Gets the remote socket address.- Overrides:
getRemoteSocketAddressin classSocket
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddressin classSocket- Throws:
SocketException
-
getSendBufferSize
Gets the send buffer size.- Overrides:
getSendBufferSizein classSocket- Throws:
SocketException
-
getSoLinger
Gets the so linger.- Overrides:
getSoLingerin classSocket- Throws:
SocketException
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeoutin classSocket- Throws:
SocketException
-
getTcpNoDelay
Gets the tcp no delay.- Overrides:
getTcpNoDelayin classSocket- Throws:
SocketException
-
getTrafficClass
Gets the traffic class.- Overrides:
getTrafficClassin classSocket- Throws:
SocketException
-
hashCode
-
isBound
-
isClosed
-
isConnected
-
isInputShutdown
public boolean isInputShutdown()Checks if is input shutdown.- Overrides:
isInputShutdownin classSocket
-
isOutputShutdown
public boolean isOutputShutdown()Checks if is output shutdown.- Overrides:
isOutputShutdownin classSocket
-
sendUrgentData
Send urgent data.- Overrides:
sendUrgentDatain classSocket- Throws:
IOException
-
setKeepAlive
Sets the keep alive.- Overrides:
setKeepAlivein classSocket- Throws:
SocketException
-
setOOBInline
Sets the OOB inline.- Overrides:
setOOBInlinein classSocket- Throws:
SocketException
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets the performance preferences.- Overrides:
setPerformancePreferencesin classSocket
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSizein classSocket- Throws:
SocketException
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddressin classSocket- Throws:
SocketException
-
setSendBufferSize
Sets the send buffer size.- Overrides:
setSendBufferSizein classSocket- Throws:
SocketException
-
setSoLinger
Sets the so linger.- Overrides:
setSoLingerin classSocket- Throws:
SocketException
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeoutin classSocket- Throws:
SocketException
-
setTcpNoDelay
Sets the tcp no delay.- Overrides:
setTcpNoDelayin classSocket- Throws:
SocketException
-
setTrafficClass
Sets the traffic class.- Overrides:
setTrafficClassin classSocket- Throws:
SocketException
-
shutdownInput
Shutdown input.- Overrides:
shutdownInputin classSocket- Throws:
IOException
-
shutdownOutput
Shutdown output.- Overrides:
shutdownOutputin classSocket- Throws:
IOException
-
toString
-