예제 #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);
            }
        }