예제 #1
0
파일: Client.cs 프로젝트: Daimakaicho/TSIO
        /// <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);
        }
예제 #2
0
파일: Server.cs 프로젝트: Daimakaicho/TSIO
        /// <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);
        }