Exemplo n.º 1
0
        public SNotiClient(IOptions <SNotiClientConfig> config)
        {
            _config = config.Value;
            sockets = new SNotiSocket(_config);

            // 订阅状态
            sockets.ConnectStatus.Subscribe(OnSSLConnectChanged,
                                            (Err) => Console.Error.WriteLine(Err.Message));
            IsLogined.Subscribe(login => IsSNotiLogined = login);

            RegisterHeartbeatSender();
        }
Exemplo n.º 2
0
 public SNotiSocket(SNotiClientConfig config)
 {
     _config       = config;
     ConnectStatus = new Subject <bool>();
     ConnectStatus.Subscribe((conn) => IsConnected = conn, (err) => System.Console.Error.WriteLine(err.Message));
 }