Пример #1
0
        /// <summary>
        /// A connection to our server, always listening asynchronously.
        /// </summary>
        /// <param name="socket">The Socket for the connection.</param>
        /// <param name="args">The SocketAsyncEventArgs for asyncronous recieves.</param>
        /// <param name="dataReceived">A callback invoked when data is recieved.</param>
        /// <param name="disconnectedCallback">A callback invoked on disconnection.</param>
        public ServerConnection(Socket socket, SocketAsyncEventArgs args, DataReceivedCallback dataReceived,
                                DisconnectedCallback disconnectedCallback)
        {
            logger = new ElibLogging("data");
            this.AuthorizationType = Securtiy.AuthorizationType.Anonymous;
            lock (this)
            {
                var   remotIP = socket.RemoteEndPoint as IPEndPoint;
                var   localIP = socket.LocalEndPoint as IPEndPoint;
                State state   = new State()
                {
                    socket               = socket,
                    dataReceived         = dataReceived,
                    disconnectedCallback = disconnectedCallback,
                    Device               = new Device()
                    {
                        RemoteIP = remotIP.Address.ToString(),
                        LocalIP  = localIP.Address.ToString()
                    }
                };

                eventArgs            = args;
                eventArgs.Completed += ReceivedCompleted;
                eventArgs.UserToken  = state;

                ListenForData(eventArgs);
            }
        }
Пример #2
0
 public AgentRecord(Guid id, string file, string args)
 {
     this.Id        = id;
     this.File      = file;
     this.Arguments = args;
     logger         = new ElibLogging("app");
 }
Пример #3
0
 public StoreProcessor(int index)
 {
     this.index    = index;
     logger        = new ElibLogging("trace");
     _service      = ServiceFactory.GetService <ICurrencyService>();
     this.DateTime = DateTime.Now;
     Items         = new List <CurrencyInfo>();
     MAX_LENGTH    = Math.Max(CurrencyStoreSection.Instance.Task.PoolSize, 10);
     storaged      = CurrencyStoreSection.Instance.Task.Storaged;
 }
Пример #4
0
        public DataProcessor()
        {
            var len = Math.Max(CurrencyStoreSection.Instance.Task.Capacity, 5);

            _tasks = new Task[len];
            for (int i = 0; i < len; i++)
            {
                var v = i;
                _tasks[i] = new Task(() => Process(v));
            }
            logger   = new ElibLogging("trace");
            _service = ServiceFactory.GetService <ICurrencyService>();
        }
 public CurrencyInfoRepository()
 {
     logger = new ElibLogging("script");
 }
Пример #6
0
 public CurrencyInfoRepository()
 {
     logger   = new ElibLogging("script");
     storaged = CurrencyStoreSection.Instance.Task.Storaged;
 }
Пример #7
0
 static Message()
 {
     logger = new ElibLogging("trace");
 }