Ejemplo n.º 1
0
        public void AcceptCallback(IAsyncResult ar)
        {
            AllDone.Set();
            var listener = (Socket)ar.AsyncState;
            var handler  = listener.EndAccept(ar);
            var state    = new HubState(Config, Fs)
            {
                WorkSocket = handler
            };

            handler.BeginReceive(state.Buffer, 0, Config.BufferSize, 0,
                                 ReadCallback, state);
        }
Ejemplo n.º 2
0
 protected void Send(HubState state)
 {
     state.Send();
     state.WorkSocket.BeginSend(state.Buffer, 0, state.BufferLen, 0,
                                SendCallback, state);
 }