By default, the server currently polls every two seconds
while waiting for an active connection to terminate, before
freeing relevant resources. This is inefficient for idle
and short-lived connections.
In this change, the polling is removed. Instead, the server
thread sleeps until it is woken up by an event indicating that
the connection has terminated or should be terminated.
This change also slightly alters the SocketPipe stop procedure,
to ensure that all PipeListeners see a consistent view of the
Pipe during onStop.
By default, the server currently polls every two seconds while waiting for an active connection to terminate, before freeing relevant resources. This is inefficient for idle and short-lived connections.
In this change, the polling is removed. Instead, the server thread sleeps until it is woken up by an event indicating that the connection has terminated or should be terminated.
This change also slightly alters the SocketPipe stop procedure, to ensure that all PipeListeners see a consistent view of the Pipe during onStop.