Exemplo n.º 1
0
 public TThreadPoolServer(Processor processor,
                          ServerTransport serverTransport,
                          TransportFactory transportFactory,
                          ProtocolFactory protocolFactory)
     : this(processor, serverTransport,
          transportFactory, transportFactory,
          protocolFactory, protocolFactory,
          DEFAULT_MIN_THREADS, DEFAULT_MAX_THREADS, DefaultLogDelegate)
 {
 }
Exemplo n.º 2
0
 public TSimpleServer(Processor processor,
                   ServerTransport serverTransport,
                   TransportFactory transportFactory)
     : base(processor,
          serverTransport,
          transportFactory,
          transportFactory,
          new BinaryProtocol.Factory(),
          new BinaryProtocol.Factory(),
          DefaultLogDelegate)
 {
 }
Exemplo n.º 3
0
 public TSimpleServer(Processor processor,
                   ServerTransport serverTransport,
                   TransportFactory transportFactory,
                   ProtocolFactory protocolFactory)
     : base(processor,
          serverTransport,
          transportFactory,
          transportFactory,
          protocolFactory,
          protocolFactory,
          DefaultLogDelegate)
 {
 }
Exemplo n.º 4
0
 public TThreadedServer(Processor processor,
                          ServerTransport serverTransport,
                          TransportFactory inputTransportFactory,
                          TransportFactory outputTransportFactory,
                          ProtocolFactory inputProtocolFactory,
                          ProtocolFactory 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>();
 }
Exemplo n.º 5
0
 public TThreadPoolServer(Processor processor,
                          ServerTransport serverTransport,
                          TransportFactory inputTransportFactory,
                          TransportFactory outputTransportFactory,
                          ProtocolFactory inputProtocolFactory,
                          ProtocolFactory outputProtocolFactory,
                          int minThreadPoolThreads, int maxThreadPoolThreads, LogDelegate logDel)
     : base(processor, serverTransport, inputTransportFactory, outputTransportFactory,
           inputProtocolFactory, outputProtocolFactory, logDel)
 {
     lock (typeof(TThreadPoolServer))
       {
     if (!ThreadPool.SetMinThreads(minThreadPoolThreads, minThreadPoolThreads))
     {
       throw new Exception("Error: could not SetMinThreads in ThreadPool");
     }
     if (!ThreadPool.SetMaxThreads(maxThreadPoolThreads, maxThreadPoolThreads))
     {
       throw new Exception("Error: could not SetMaxThreads in ThreadPool");
     }
     }
 }
Exemplo n.º 6
0
 public Server(Processor processor,
                   ServerTransport serverTransport,
                   TransportFactory inputTransportFactory,
                   TransportFactory outputTransportFactory,
                   ProtocolFactory inputProtocolFactory,
                   ProtocolFactory outputProtocolFactory,
                   LogDelegate logDelegate)
 {
     this.processor = processor;
     this.serverTransport = serverTransport;
     this.inputTransportFactory = inputTransportFactory;
     this.outputTransportFactory = outputTransportFactory;
     this.inputProtocolFactory = inputProtocolFactory;
     this.outputProtocolFactory = outputProtocolFactory;
     this.logDelegate = logDelegate;
 }