Esempio n. 1
0
        private void ReadFrame()
        {
            transport.ReadAll(headerBuf, 0, HeaderSize);
            int size = DecodeFrameSize(headerBuf);

            readBuffer.SetLength(size);
            readBuffer.Seek(0, SeekOrigin.Begin);
            byte[] buff = readBuffer.GetBuffer();
            transport.ReadAll(buff, 0, size);
        }
        private void ReadFrame()
        {
            byte[] i32rd = new byte[header_size];
            transport.ReadAll(i32rd, 0, header_size);
            int size = DecodeFrameSize(i32rd);

            byte[] buff = new byte[size];
            transport.ReadAll(buff, 0, size);
            readBuffer = new MemoryStream(buff);
        }
Esempio n. 3
0
        private void ReadFrame()
        {
            byte[] i32rd = new byte[header_size];
            transport.ReadAll(i32rd, 0, header_size);
            int size =
                ((i32rd[0] & 0xff) << 24) |
                ((i32rd[1] & 0xff) << 16) |
                ((i32rd[2] & 0xff) << 8) |
                ((i32rd[3] & 0xff));

            byte[] buff = new byte[size];
            transport.ReadAll(buff, 0, size);
            readBuffer = new MemoryStream(buff);
        }