Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueProcessManager"/> class.
        /// </summary>
        /// <param name="asyncHandler">if set to <c>true</c> [async handler].</param>
        protected QueueProcessManagerEx(QueueProcessMode mode, IExecutorService executorService, int capacity, int queueTimeout, bool isLogging)
            : base(executorService)
        {
            _mode = mode;

            if (mode == QueueProcessMode.Thread)
            {
                _queue = ProducerConsumerQueueFactory.Create<T>(executorService, capacity, queueTimeout, isLogging);
                _queue.Dequeue += OnQueue_Dequeue;
            }
        }
Esempio n. 2
0
        internal TcpSocketTransceiverImpl(IExecutorService executorService, UdpSocketTransceiverParameter parameter)
            : base(executorService)
        {
            _parameter   = parameter;
            _readBuffer  = new byte[Math.Max(256, parameter.ReadBufferSize)];
            _writeBuffer = new byte[Math.Max(256, parameter.WriteBufferSize)];

            _useInternalQueue = parameter.UseInternalQueue;
            if (_useInternalQueue)
            {
                _queueReceived = ProducerConsumerQueueFactory.Create <UdpSocketReceiveData>(executorService, -1,
                                                                                            parameter.ListenWaitTime, false);
                _queueReceived.Dequeue += this.OnDataReceived;
            }
            _remoteEndPoints = new SortedDictionary <IPAddress, EndPoint>(new IPAddressComparer());
        }
        public ServiceMainForm(IExecutorService executorService, IServiceHost serviceHost)
        {
            InitializeComponent();
            SetTagProperty();
            this.ResolveResources();

            _normalFont = this.Font;
            _boldFont   = new Font(this.Font, FontStyle.Bold);

            _queue          = ProducerConsumerQueueFactory.Create <LogItem>(executorService, -1);
            _queue.Dequeue += OnQueue_Dequeue;

            Log.GlobalWriteToExternalLog += new WriteToExternalLogHandler(Log_WriteToExternalLog);
            _setStatus = new SetStatusHandler(this.SetStatus);

            _serviceHost = serviceHost;
        }
Esempio n. 4
0
 public FFTransReceiver_InMemory(FFTransceiverArgs arg, IExecutorService executorService)
     : base(arg, executorService)
 {
     // create a listener thread and do the receive processing
     _queue = ProducerConsumerQueueFactory.Create <UdpFreeformEntity>(executorService, -1);
 }