Constructs the queue with the given size.
Attempts to remove the next available socket from the queue, waiting for a pre-determined time, before timing out. If no socket becomes available, null may be returned.
Adds a socket to the queue, using synchronization on this queue instance for thread-safety.
Manually notifies this queue's internal semaphore, which might be used to free up any threads that are waiting for a socket, usually used on shutdown.
A simple array-based queue that uses synchronization to handle concurrent access to the data. The queue is blocked when requests are added, and when they're removed. It's not the best performance, but it just works.