Execute forceClose with an executor task inside forceReconnect. This prevents the force reconnect behavior from being blocked if close blocks.
SocketDataPortWithWriteTimeout tuning
In the SocketDataPortWithWriteTimeout implementation of the timeout watcher task:
Call the forceReconnect directly instead of running it on an executor task thread. It's already running on an executor task thread because that's where the watcher runs.
Removed the call to close the output stream of the socket. It's going to get closed anyway when the socket gets closed.
Socket SO LINGER
Added an Options.socketSoLinger(int socketSoLinger) for the user to set the underlying socket.setSoLinger(). This will be used in normal close operations. If a forceClose is requested, any option value supplied will be overridden with setSoLinger(true, 0)
Force Close
Added a forceClose() to the DataPort interface (with a default implementation that calls close(), to ensure interface backward compatibility)
the base internal implementation, SocketDataPort implements forceClose()
Force Reconnect improvement
Execute
forceClose
with an executor task insideforceReconnect
. This prevents the force reconnect behavior from being blocked if close blocks.SocketDataPortWithWriteTimeout tuning
In the SocketDataPortWithWriteTimeout implementation of the timeout watcher task:
forceReconnect
directly instead of running it on an executor task thread. It's already running on an executor task thread because that's where the watcher runs.Socket SO LINGER
Added an
Options.socketSoLinger(int socketSoLinger)
for the user to set the underlyingsocket.setSoLinger()
. This will be used in normal close operations. If aforceClose
is requested, any option value supplied will be overridden withsetSoLinger(true, 0)
Force Close
Added a
forceClose()
to theDataPort
interface (with a default implementation that callsclose()
, to ensure interface backward compatibility)SocketDataPort
implementsforceClose()
forceReconnect
callsforceClose()
handleCommunicationIssue
callsforceClose