Esempio n. 1
0
        public ClientHandler(IWinCommands actuator, TcpClient client, string clientId, SslStream sslStream)
        {
            messageQueue  = new BlockingCollection <Sinter>(_messageQueue);
            this.actuator = actuator;

            connectionHandler = new ConnectionHandler(client, clientId, messageQueue, sslStream);
            commandHandler    = new CommandHandler(connectionHandler, messageQueue, this.actuator);

            this.actuator.connection = connectionHandler;

            connectionHandler.StartConnectionHandling();
            commandHandler.StartCommandHandling();
        }
Esempio n. 2
0
        public IWinCommands actuator; // could be a server or a client

        public CommandHandler(ConnectionHandler connectionHandler, BlockingCollection <Sinter> messageQueue, IWinCommands actuator)
        {
            // load service-code key-values
            serviceCodes = Config.getConfig("service_code");
            if (serviceCodes != null)
            {
                serviceCodesRev = serviceCodes.ToDictionary(kp => kp.Value, kp => kp.Key);
            }
            else
            {
                log.Error("Unable to load service_codes dictionary");
            }
            //type = GetType();
            type = typeof(IWinCommands);

            this.connectionHandler = connectionHandler;
            this.messageQueue      = messageQueue;
            this.actuator          = actuator;
        }