コード例 #1
0
 public RunInteractive(ISteamSessionFactory steamSessionFactory, IServiceMessenger messenger)
     : base(steamSessionFactory) {
     IsCommand("interactive", "Run in interactive mode");
     HasOption("b|bind=", "The address to listen on", s => Bind = s);
     _steamSessionFactory = steamSessionFactory;
     _messenger = messenger;
 }
コード例 #2
0
        private void InitiationChannel(string ip, string port, IMessageCallback callback)
        {
            try
            {
                Uri address = new Uri($"net.tcp://{ip}:{port}/IServiceMessenger");

                NetTcpBinding binding = new NetTcpBinding();
                binding.MaxReceivedMessageSize = Int32.MaxValue;

                EndpointAddress endpoint        = new EndpointAddress(address);
                InstanceContext instanceContext = new InstanceContext(callback);
                DuplexChannelFactory <IServiceMessenger> factory = new DuplexChannelFactory <IServiceMessenger>(instanceContext, binding, endpoint);
                factory.Closed  += FactoryOnClosed;
                factory.Faulted += FactoryOnClosed;
                _channel         = factory.CreateChannel();
                _timer           = new Timer(10000);
                _timer.Enabled   = true;
                _timer.AutoReset = true;
                _timer.Elapsed  += TimerOnElapsed;
                _lastConnect     = DateTime.Now;
            }
            catch (Exception ex)
            {
            }
        }
コード例 #3
0
 public RunInteractive(ISteamSessionFactory steamSessionFactory, IServiceMessenger messenger)
     : base(steamSessionFactory)
 {
     IsCommand("interactive", "Run in interactive mode");
     HasOption("b|bind=", "The address to listen on", s => Bind = s);
     _steamSessionFactory = steamSessionFactory;
     _messenger           = messenger;
 }