コード例 #1
0
 public Dispatcher(DofusClient client)
 {
     this.client = client;
     methods     = new Dictionary <uint, MethodHandler>();
     msgQueue    = new Queue <NetworkMessage>();
     timer       = new TimerCore(new Action(Execute), 50, 50);
 }
コード例 #2
0
ファイル: Client.cs プロジェクト: xvolks/Cookie
        protected virtual void SocketAsyncEventArgs_Completed(object sender, SocketAsyncEventArgs e)
        {
            ReceiveEvent = new SocketAsyncEventArgs();
            ReceiveEvent.SetBuffer(buffer, 0, buffer.Length);
            ReceiveEvent.Completed += ReceiveEvent_Completed;

            _timer = new TimerCore(new Action(CheckDisonnect), 50, 1000);

            if (!Socket.ReceiveAsync(ReceiveEvent))
            {
                ReceiveEvent_Completed(Socket, ReceiveEvent);
            }
        }
コード例 #3
0
ファイル: Client.cs プロジェクト: xvolks/Cookie
        public Client(Socket socket)
        {
            _sender        = new object();
            Socket         = socket;
            Socket.NoDelay = true;

            ReceiveEvent = new SocketAsyncEventArgs();
            ReceiveEvent.SetBuffer(buffer, 0, buffer.Length);
            ReceiveEvent.Completed += ReceiveEvent_Completed;

            _timer = new TimerCore(new Action(CheckDisonnect), 50, 1000);

            if (!Socket.ReceiveAsync(ReceiveEvent))
            {
                ReceiveEvent_Completed(Socket, ReceiveEvent);
            }
        }