/// <summary> /// /// </summary> /// <param name="numConnections"></param> /// <param name="receiveBufferSize"></param> public Client(int receiveBufferSize) { IsRunning = false; this.receiveBufferSize = receiveBufferSize; bufferManager = new BufferManager(receiveBufferSize * opsToPreAlloc, receiveBufferSize); ReadWritePool = new SocketAsyncEventArgsPool(10); }
/// <summary> /// /// </summary> /// <param name="numConnections"></param> /// <param name="receiveBufferSize"></param> public Server(int numConnections, int receiveBufferSize) { IsRunning = false; totalBytesRead = 0; connectionsCount = 0; backlog = numConnections; maxConnectionsCount = numConnections; this.receiveBufferSize = receiveBufferSize; bufferManager = new BufferManager(receiveBufferSize * numConnections * opsToPreAlloc, receiveBufferSize); ReadWritePool = new SocketAsyncEventArgsPool(maxConnectionsCount); connectionsSemaphore = new Semaphore(maxConnectionsCount, maxConnectionsCount); }
/// <summary> /// /// </summary> public void Dispose() { Stop(); ReadWritePool = null; }