Exemple #1
0
 public static TCPChannel Instance(int port, ILogging logger, System.Diagnostics.EventLog offLogger)
 {
     if (instance == null)
     {
         instance = new TCPChannel(port, logger, offLogger);
     }
     return(instance);
 }
Exemple #2
0
        /// <summary>
        /// a constructor fore the server, setting a logger, imageservice model and an imange controller,
        /// also a dictionary of commans
        /// </summary>
        /// <param name="m_logging"></param>
        public ImageServer(ILogging m_logging, System.Diagnostics.EventLog eventLog)
        {
            this.logger = m_logging;
            ImageServiceModal iModal = new ImageServiceModal();

            this.imageController = new ImageController(iModal);
            Dictionary <int, ICommand> commandsList = new Dictionary <int, ICommand>()
            {
                { 1, new NewFileCommand(iModal) }
            };

            this.channel = TCPChannel.Instance(80, this.logger, eventLog);
            this.channel.Start();
            this.channel.startSendingLogs += subscribeToSendLogs;
            this.channel.GotCommand       += getCommand;
        }