예제 #1
0
 public TcpClientConnector()
 {
     _connectSocketArgsPool = new SocketArgsPool("TcpClientConnector._connectSocketArgsPool",
                                                 TcpConfiguration.ConnectPoolSize,
                                                 CreateConnectSocketArgs);
     _pendingConections = new ConcurrentDictionary<Guid, PendingConnection>();
     _timer = new Timer(TimerCallback, null, CheckPeriodMs, Timeout.Infinite);
 }
예제 #2
0
 public TcpClientConnector()
 {
     _connectSocketArgsPool = new SocketArgsPool("TcpClientConnector._connectSocketArgsPool",
                                                 TcpConfiguration.ConnectPoolSize,
                                                 CreateConnectSocketArgs);
     _pendingConections = new ConcurrentDictionary <Guid, PendingConnection>();
     _timer             = new Timer(TimerCallback, null, CheckPeriodMs, Timeout.Infinite);
 }
예제 #3
0
        public TcpServerListener(IPEndPoint serverEndPoint)
        {
            _serverEndPoint = serverEndPoint;
            _listeningSocket = new Socket(_serverEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            _acceptSocketArgsPool = new SocketArgsPool("TcpServerListener.AcceptSocketArgsPool",
                ConcurrentAccepts*2,
                CreateAcceptSocketArgs);
        }
예제 #4
0
        public TcpServerListener(IPEndPoint serverEndPoint)
        {
            _serverEndPoint  = serverEndPoint;
            _listeningSocket = new Socket(_serverEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            _acceptSocketArgsPool = new SocketArgsPool("TcpServerListener.AcceptSocketArgsPool",
                                                       ConcurrentAccepts * 2,
                                                       CreateAcceptSocketArgs);
        }
예제 #5
0
 static TcpConnection()
 {
     BufferManager = new BufferManager(TcpConfiguration.BufferChunksCount, TcpConfiguration.SocketBufferSize);
     SocketArgsPool = new SocketArgsPool("TcpConnection.SocketArgsPool", TcpConfiguration.SendReceivePoolSize, () => new SocketAsyncEventArgs());
 }
예제 #6
0
 static TcpConnection()
 {
     BufferManager  = new BufferManager(TcpConfiguration.BufferChunksCount, TcpConfiguration.SocketBufferSize);
     SocketArgsPool = new SocketArgsPool("TcpConnection.SocketArgsPool", TcpConfiguration.SendReceivePoolSize, () => new SocketAsyncEventArgs());
 }