public interface ServerConnection
Server connection abstraction, used by any provider to handle a socket connection.
handleStart handling the connection. Data is provided through
requestSemaphore- semaphore that is responsible for maximal concurrent request limit, the connection implementation is responsible for acquiring a permit from the semaphore for the duration of a request, and releasing it when the request ends; please be very careful, as this may lead to complete stop of the server if incorrectly implemented
InterruptedException- to interrupt any waiting state and terminate this connection
idleTimeDuration idleTime()How long is this connection idle. This is a duration from the last request to now.
- idle duration
(boolean interrupt)Close a connection. This may be called during shutdown of the server, or when idle timeout is reached.
interrupt- whether to interrupt in progress requests (always interrupts idle requests waiting for initial request data)