public void ProcessMessage(byte[] bytes) { var stream = new SpStream(bytes, 0, bytes.Length, bytes.Length); var result = _rpc.Dispatch(stream); _client.ProcessMessage(result); }
private void EndReceive(IAsyncResult asr) { try { var buffer = _udpClient.EndReceive(asr, ref _endPoint); if (buffer.Length > 0) { var resp = Protocol.Parse(buffer, buffer.Length); _client.ProcessMessage(resp); } else { _client.NetWorkChanged(NetWorkState.Closed); } } catch (SocketException) { _client.NetWorkChanged(NetWorkState.Error); } }