示例#1
0
        void IConnector.Bind(IReactor dispatcher, IProtocolFactory factory, IPEndPoint localEP, int bufferSize)
        {
            _udpClient = new UdpClient(localEP);
            _udpClient.Client.ReceiveBufferSize = bufferSize;

            var protocol = factory.Create();

            var connection = new DatagramConnection(dispatcher, protocol, _udpClient);
            connection.Start(true);

            protocol.Bind(connection);
            protocol.Connected();
        }
示例#2
0
        void IConnector.Bind(IReactor dispatcher, IProtocolFactory factory, IPEndPoint localEP, int bufferSize)
        {
            _udpClient = new UdpClient(localEP);
            _udpClient.Client.ReceiveBufferSize = bufferSize;

            var protocol = factory.Create();

            var connection = new DatagramConnection(dispatcher, protocol, _udpClient);

            connection.Start(true);

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