private void ReadLengthPrefix(Client client, bool continuous) { if (client.Disposed) { return; } PrefixReader prefixReader = new PrefixReader(this.server.Buffers); try { client.Socket.BeginReceive( prefixReader.Buffer, 0, PrefixReader.PrefixBytes, SocketFlags.None, this.LengthPrefixReceivedCallback, Tuple.Create(client, prefixReader, continuous)); } catch { client.ErrorsAccumulated++; prefixReader.Dispose(); client.Dispose(); } }
private void ReadLengthPrefix(bool continuous) { PrefixReader prefixReader = new PrefixReader(this.client.Buffers); try { this.client.Socket.BeginReceive( prefixReader.Buffer, 0, PrefixReader.PrefixBytes, SocketFlags.None, this.LengthPrefixReceivedCallback, Tuple.Create(prefixReader, continuous)); } catch { prefixReader.Dispose(); this.ReadMessagesContinuously(); } }