Ejemplo n.º 1
0
		/**
		 * Default constructors.
		 */

		public TServer(TProcessor processor,
		               TServerTransport serverTransport)
			: this(
				processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(),
				new TBinaryProtocol.Factory(), DefaultLogDelegate)
		{
		}
Ejemplo n.º 2
0
		public TThreadPoolServer(TProcessor processor, TServerTransport serverTransport)
			:this(processor, serverTransport,
				 new TTransportFactory(), new TTransportFactory(),
				 new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(),
				 DEFAULT_MIN_THREADS, DEFAULT_MAX_THREADS, DefaultLogDelegate)
		{
		}
Ejemplo n.º 3
0
        public TThreadedServer(TProcessor processor, TServerTransport serverTransport, LogDelegate logDelegate)
            : this(processor, serverTransport,
				 new TTransportFactory(), new TTransportFactory(),
				 new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(),
				 DEFAULT_MAX_THREADS, logDelegate)
        {
        }
 public TThreadedServer(TProcessor processor, TServerTransport serverTransport)
     : this(new TSingletonProcessorFactory(processor), serverTransport,
      new TTransportFactory(), new TTransportFactory(),
      new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory(),
      DEFAULT_MAX_THREADS, DefaultLogDelegate)
 {
 }
Ejemplo n.º 5
0
		public TSimpleServer(TProcessor processor,
		                     TServerTransport serverTransport,
		                     LogDelegate logDel)
			: base(
				processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(),
				new TBinaryProtocol.Factory(), logDel)
		{
		}
Ejemplo n.º 6
0
        public TThreadPoolServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory transportFactory,
								 TProtocolFactory protocolFactory)
            : this(processor, serverTransport,
				 transportFactory, transportFactory,
				 protocolFactory, protocolFactory,
				 DEFAULT_MIN_THREADS, DEFAULT_MAX_THREADS)
        {
        }
        public MockThriftServer()
        {
            _handler = new Handler();
            var processor = new ThriftFlumeEventServer.Processor(_handler);
            _serverTransport = new TServerSocket(9090);
            _server = new TThreadedServer(processor, _serverTransport);

            _serveOnSeparateThread = new Thread(_server.Serve);
            _serveOnSeparateThread.Start();
        }
 public TThreadPoolServer(TProcessor processor,
  TServerTransport serverTransport,
  TTransportFactory transportFactory,
  TProtocolFactory protocolFactory)
     : this(new TSingletonProcessorFactory(processor), serverTransport,
        transportFactory, transportFactory,
        protocolFactory, protocolFactory,
        DEFAULT_MIN_THREADS, DEFAULT_MAX_THREADS, DefaultLogDelegate)
 {
 }
Ejemplo n.º 9
0
        public TThreadedServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory transportFactory,
								 TProtocolFactory protocolFactory)
            : this(processor, serverTransport,
				 transportFactory, transportFactory,
				 protocolFactory, protocolFactory,
				 DEFAULT_MAX_THREADS, DefaultLogDelegate)
        {
        }
Ejemplo n.º 10
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory transportFactory)
            : this(processor,
				 serverTransport,
				 transportFactory,
				 transportFactory,
				 new TBinaryProtocol.Factory(),
				 new TBinaryProtocol.Factory())
        {
        }
Ejemplo n.º 11
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory transportFactory,
						  TProtocolFactory protocolFactory)
            : this(processor,
				 serverTransport,
				 transportFactory,
				 transportFactory,
				 protocolFactory,
				 protocolFactory)
        {
        }
Ejemplo n.º 12
0
 public TSimpleServer(TProcessor processor,
       TServerTransport serverTransport,
       TTransportFactory transportFactory)
     : base(processor,
  serverTransport,
  transportFactory,
  transportFactory,
  new TBinaryProtocol.Factory(),
  new TBinaryProtocol.Factory(),
    DefaultLogDelegate)
 {
 }
Ejemplo n.º 13
0
 public TSimpleServer(TProcessor processor,
       TServerTransport serverTransport,
       TTransportFactory transportFactory,
       TProtocolFactory protocolFactory)
     : base(processor,
  serverTransport,
  transportFactory,
  transportFactory,
  protocolFactory,
  protocolFactory,
  DefaultLogDelegate)
 {
 }
Ejemplo n.º 14
0
        public TThreadedServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory inputTransportFactory,
								 TTransportFactory outputTransportFactory,
								 TProtocolFactory inputProtocolFactory,
								 TProtocolFactory outputProtocolFactory,
								 int maxThreads, LogDelegate logDel)
            : base(processor, serverTransport, inputTransportFactory, outputTransportFactory,
				  inputProtocolFactory, outputProtocolFactory, logDel)
        {
            this.maxThreads = maxThreads;
            clientQueue = new Queue<TTransport>();
            clientLock = new object();
            clientThreads = new THashSet<Thread>();
        }
Ejemplo n.º 15
0
        public TThreadPoolServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory inputTransportFactory,
								 TTransportFactory outputTransportFactory,
								 TProtocolFactory inputProtocolFactory,
								 TProtocolFactory outputProtocolFactory,
								 int minThreadPoolThreads, int maxThreadPoolThreads, LogDelegate logDel)
            : base(processor, serverTransport, inputTransportFactory, outputTransportFactory,
				  inputProtocolFactory, outputProtocolFactory, logDel)
        {
            if (!ThreadPool.SetMaxThreads(maxThreadPoolThreads, maxThreadPoolThreads))
            {
                throw new Exception("Error: could not SetMaxThreads in ThreadPool");
            }
        }
Ejemplo n.º 16
0
        public TSimpleServer(TProcessor processor,
						  TServerTransport serverTransport)
            : base(processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory())
        {
        }
Ejemplo n.º 17
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory inputTransportFactory,
						  TTransportFactory outputTransportFactory,
						  TProtocolFactory inputProtocolFactory,
						  TProtocolFactory outputProtocolFactory)
        {
            this.processor = processor;
            this.serverTransport = serverTransport;
            this.inputTransportFactory = inputTransportFactory;
            this.outputTransportFactory = outputTransportFactory;
            this.inputProtocolFactory = inputProtocolFactory;
            this.outputProtocolFactory = outputProtocolFactory;
        }
Ejemplo n.º 18
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory inputTransportFactory,
						  TTransportFactory outputTransportFactory,
						  TProtocolFactory inputProtocolFactory,
						  TProtocolFactory outputProtocolFactory,
						  LogDelegate logDelegate)
        {
            this.processor = processor;
            this.serverTransport = serverTransport;
            this.inputTransportFactory = inputTransportFactory;
            this.outputTransportFactory = outputTransportFactory;
            this.inputProtocolFactory = inputProtocolFactory;
            this.outputProtocolFactory = outputProtocolFactory;
            this.logDelegate = (logDelegate != null) ? logDelegate : DefaultLogDelegate;
        }