/**
		 * Default constructors.
		 */

		public TServer(TProcessor processor,
		               TServerTransport serverTransport)
			: this(
				processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(),
				new TBinaryProtocol.Factory(), DefaultLogDelegate)
		{
		}
Exemple #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)
		{
		}
Exemple #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)
 {
 }
		public TSimpleServer(TProcessor processor,
		                     TServerTransport serverTransport,
		                     LogDelegate logDel)
			: base(
				processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(),
				new TBinaryProtocol.Factory(), logDel)
		{
		}
Exemple #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)
 {
 }
Exemple #9
0
        public TThreadedServer(TProcessor processor,
								 TServerTransport serverTransport,
								 TTransportFactory transportFactory,
								 TProtocolFactory protocolFactory)
            : this(processor, serverTransport,
				 transportFactory, transportFactory,
				 protocolFactory, protocolFactory,
				 DEFAULT_MAX_THREADS, DefaultLogDelegate)
        {
        }
Exemple #10
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory transportFactory)
            : this(processor,
				 serverTransport,
				 transportFactory,
				 transportFactory,
				 new TBinaryProtocol.Factory(),
				 new TBinaryProtocol.Factory())
        {
        }
Exemple #11
0
        public TServer(TProcessor processor,
						  TServerTransport serverTransport,
						  TTransportFactory transportFactory,
						  TProtocolFactory protocolFactory)
            : this(processor,
				 serverTransport,
				 transportFactory,
				 transportFactory,
				 protocolFactory,
				 protocolFactory)
        {
        }
Exemple #12
0
 public TSimpleServer(TProcessor processor,
       TServerTransport serverTransport,
       TTransportFactory transportFactory)
     : base(processor,
  serverTransport,
  transportFactory,
  transportFactory,
  new TBinaryProtocol.Factory(),
  new TBinaryProtocol.Factory(),
    DefaultLogDelegate)
 {
 }
Exemple #13
0
 public TSimpleServer(TProcessor processor,
       TServerTransport serverTransport,
       TTransportFactory transportFactory,
       TProtocolFactory protocolFactory)
     : base(processor,
  serverTransport,
  transportFactory,
  transportFactory,
  protocolFactory,
  protocolFactory,
  DefaultLogDelegate)
 {
 }
Exemple #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>();
        }
Exemple #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");
            }
        }
        public TSimpleServer(TProcessor processor,
						  TServerTransport serverTransport)
            : base(processor, serverTransport, new TTransportFactory(), new TTransportFactory(), new TBinaryProtocol.Factory(), new TBinaryProtocol.Factory())
        {
        }
Exemple #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;
        }
Exemple #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;
        }