public PureWebSocket(string url, IPureWebSocketOptions options)
        {
            _options = (PureWebSocketOptions)options;
            Url      = url;

            Log("Creating new instance.");

            Task.Run(() =>
            {
                Monitor();
            });
        }
Beispiel #2
0
        public PureWebSocket(string url, IPureWebSocketOptions options)
        {
            _options = (PureWebSocketOptions)options;
            Url      = url;

            _autoReconnect = _options.MyReconnectStrategy != null &&
                             !_options.MyReconnectStrategy.AreAttemptsComplete() &&
                             _options.MyReconnectStrategy.GetReconnectInterval() > 0 &&
                             _options.MyReconnectStrategy.GetReconnectInterval() != int.MaxValue;

            _logger = new Logger(_options);

            _logger.Log("Creating new instance.");

            InitializeClient();

            StartMonitor();
        }
Beispiel #3
0
        public PureWebSocket(string url, IPureWebSocketOptions options)
        {
            InstanceName = $"I{DateTime.UtcNow.Ticks.ToString()}";
            _options     = (PureWebSocketOptions)options;
            Url          = url;

            _autoReconnect = _options.MyReconnectStrategy != null &&
                             !_options.MyReconnectStrategy.AreAttemptsComplete() &&
                             _options.MyReconnectStrategy.GetReconnectInterval() > 0 &&
                             _options.MyReconnectStrategy.GetReconnectInterval() != int.MaxValue;

            _logger = new Logger(_options);

            _logger.Log($"Creating new instance name {InstanceName}.");

            InitializeClient();

            StartMonitor();
        }
Beispiel #4
0
 public Logger(PureWebSocketOptions options)
 {
     _options = options;
 }