Example #1
0
        private void ClientAcceptCallback(IAsyncResult ar)
        {
            var tcpClient = ((TcpListener)ar.AsyncState).EndAcceptTcpClient(ar);
            var protocol = _factory.Create();

            var connection = new StreamConnection(_dispatcher, protocol, tcpClient, _bufferSize);
            connection.Start(true);

            protocol.Bind(connection);
            protocol.Connected();

            this.StartAccept();
        }
Example #2
0
        private void PeerConnectCallback(IAsyncResult ar)
        {
            var tcpClient = ((TcpClient)ar.AsyncState);
            tcpClient.EndConnect(ar);

            var protocol = _factory.Create();

            var connection = new StreamConnection(_dispatcher, protocol, tcpClient, _bufferSize);

            protocol.Bind(connection);
            protocol.Connected();

            connection.Start(false);
        }
Example #3
0
        private void ClientAcceptCallback(IAsyncResult ar)
        {
            var tcpClient = ((TcpListener)ar.AsyncState).EndAcceptTcpClient(ar);
            var protocol  = _factory.Create();

            var connection = new StreamConnection(_dispatcher, protocol, tcpClient, _bufferSize);

            connection.Start(true);

            protocol.Bind(connection);
            protocol.Connected();

            this.StartAccept();
        }
Example #4
0
        private void PeerConnectCallback(IAsyncResult ar)
        {
            var tcpClient = ((TcpClient)ar.AsyncState);

            tcpClient.EndConnect(ar);

            var protocol = _factory.Create();

            var connection = new StreamConnection(_dispatcher, protocol, tcpClient, _bufferSize);

            protocol.Bind(connection);
            protocol.Connected();

            connection.Start(false);
        }