Orient.Client.Protocol.Connection.GetNetworkStream C# (CSharp) Method

GetNetworkStream() private method

private GetNetworkStream ( ) : Stream
return Stream
        internal Stream GetNetworkStream()
        {
            return _networkStream;
        }

Usage Example

Example #1
0
        public void Receive()
        {
            Reader = new BinaryReader(Connection.GetNetworkStream());
            var reader = Reader;

            Status    = (ResponseStatus)reader.ReadByte();
            SessionId = reader.ReadInt32EndianAware();

            if (Status == ResponseStatus.ERROR)
            {
                string exceptionString = "";

                byte followByte = reader.ReadByte();

                while (followByte == 1)
                {
                    int exceptionClassLength = reader.ReadInt32EndianAware();
                    exceptionString += System.Text.Encoding.Default.GetString(reader.ReadBytes(exceptionClassLength)) + ": ";

                    int exceptionMessageLength = reader.ReadInt32EndianAware();

                    // don't read exception message string if it's null
                    if (exceptionMessageLength != -1)
                    {
                        exceptionString += System.Text.Encoding.Default.GetString(reader.ReadBytes(exceptionMessageLength)) + "\n";
                    }

                    followByte = reader.ReadByte();
                }

                throw new OException(OExceptionType.Operation, exceptionString);
            }
        }
All Usage Examples Of Orient.Client.Protocol.Connection::GetNetworkStream