Class SocketManager

java.lang.Object
net.officefloor.server.SocketManager

public class SocketManager extends Object
Manages the Socket interaction.
Author:
Daniel Sagenschneider
  • Field Details

  • Constructor Details

    • SocketManager

      public SocketManager(int listenerCount, int socketReceiveBufferSize, int maxReadsOnSelect, int maxActiveSocketRequests, StreamBufferPool<ByteBuffer> bufferPool, int socketSendBufferSize) throws IOException
      Instantiate.
      Parameters:
      listenerCount - Number of SocketManager.SocketListener instances.
      socketReceiveBufferSize - Receive buffer size for the Socket.
      maxReadsOnSelect - Maximum number of reads per SocketChannel per select. The Selector has locking overheads that slow performance. By undertaking multiple reads on the SocketChannel it makes draining and servicing more efficient (and subsequently faster). This also allows the StreamBuffer sizes to be smaller than the receive Socket buffer size (but still maintain efficiency).
      maxActiveSocketRequests - Maximum number of active SocketManager.SocketRequest instances per accepted Socket.
      bufferPool - StreamBufferPool.
      socketSendBufferSize - Send buffer size for the Socket.
      Throws:
      IOException - If fails to initialise Socket management.
  • Method Details