public Dispatcher(DofusClient client) { this.client = client; methods = new Dictionary <uint, MethodHandler>(); msgQueue = new Queue <NetworkMessage>(); timer = new TimerCore(new Action(Execute), 50, 50); }
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); } }
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); } }