Esempio n. 1
0
        public static void Run()
        {
            var socket        = SocketBuilder.GetSocket();
            var networkStream = new NetworkStream(socket);
            var buffer        = new byte[0x1000];

            // begin
            var task = networkStream.ReadAsync(buffer, 0, 1);

            // end

            task.Wait();

            Logger.Log("Byte: {0}", buffer[0]);
        }
Esempio n. 2
0
        public static void Run()
        {
            var socket        = SocketBuilder.GetSocket();
            var networkStream = new NetworkStream(socket);

            // begin
            var b = networkStream.ReadByte();

            if (b == -1)
            {
                return;
            }
            // end

            Logger.Log("Value: {0}", b);
        }
Esempio n. 3
0
        public static void Run()
        {
            var socket        = SocketBuilder.GetSocket();
            var networkStream = new NetworkStream(socket);
            var buffer        = new byte[0x1];

            // begin
            var readByteCount = networkStream.Read(buffer, 0, 1);

            if (readByteCount == 0)
            {
                return;
            }
            // end

            Logger.Log("Byte: {0}", buffer[0]);
        }