Пример #1
0
        public MqttClientOptionsBuilder WithWebSocketServer(string uri)
        {
            _webSocketOptions = new MqttClientWebSocketOptions
            {
                Uri = uri
            };

            return(this);
        }
Пример #2
0
        public MqttClientOptionsBuilder WithWebSocketServer(string uri, IDictionary <string, string> headers = null)
        {
            _webSocketOptions = new MqttClientWebSocketOptions
            {
                Uri            = uri,
                RequestHeaders = headers,
            };

            return(this);
        }
Пример #3
0
        public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters = null)
        {
            _webSocketOptions = new MqttClientWebSocketOptions
            {
                Uri             = uri,
                RequestHeaders  = parameters?.RequestHeaders,
                CookieContainer = parameters?.CookieContainer
            };

            return(this);
        }
Пример #4
0
        public MqttClientOptionsBuilder WithWebSocketServer(Action <MqttClientWebSocketOptions> optionsBuilder)
        {
            if (optionsBuilder == null)
            {
                throw new ArgumentNullException(nameof(optionsBuilder));
            }

            _webSocketOptions = new MqttClientWebSocketOptions();
            optionsBuilder.Invoke(_webSocketOptions);

            return(this);
        }