Пример #1
0
        public void ProcessRequest(Stream input, Stream output)
        {
            TTransport transport = new TStreamTransport(input,output);

            Serializer inputProtocol = null;
            Serializer outputProtocol = null;

            try
            {
                inputProtocol = inputProtocolFactory.GetProtocol(transport);
                outputProtocol = outputProtocolFactory.GetProtocol(transport);

                while (processor.Process(inputProtocol, outputProtocol)) { }
            }
            catch (TTransportException)
            {
                // Client died, just move on
            }
            catch (RPCException tx)
            {
                Console.Error.Write(tx);
            }
            catch (Exception x)
            {
                Console.Error.Write(x);
            }

            transport.Close();
        }
Пример #2
0
 public TBufferedTransport(TStreamTransport transport, int bufSize)
 {
     this.bufSize = bufSize;
     this.transport = transport;
     InitBuffers();
 }
Пример #3
0
 public TBufferedTransport(TStreamTransport transport)
     : this(transport, 1024)
 {
 }