Beispiel #1
0
        private void ReceiveHeader()
        {
            var buffer = ReceiveBuffer.Create(4);

            lock (_connection)
            {
                _connection.BeginReceive(buffer.Buffer, buffer.ReceivedBytes, buffer.Buffer.Length, SocketFlags.None,
                                         _readHeaderCallback, buffer);
            }
        }
Beispiel #2
0
        private void ReceiveBody(int size)
        {
            var buffer = ReceiveBuffer.Create(size);

            lock (_connection)
            {
                _connection.BeginReceive(buffer.Buffer, buffer.ReceivedBytes, buffer.Buffer.Length, SocketFlags.None,
                                         _readBodyCallback, buffer);
            }
        }