public AblySimpleRestClient(AblyOptions options, IAblyHttpClient httpClient) { _options = options; _httpClient = httpClient; _protocol = _options.UseBinaryProtocol == false ? Protocol.Json : Protocol.MsgPack; _messageHandler = new MessageHandler(_protocol); }
/// <summary> /// Initialises the rest client and validates the passed in options /// </summary> private void InitialiseAbly() { if (_options == null) { Logger.Error("No options provider to Ably rest"); throw new AblyException("Invalid options"); } _protocol = _options.UseBinaryProtocol == false ? Protocol.Json : Protocol.MsgPack; Logger.Debug("Protocol set to: " + _protocol); _messageHandler = new MessageHandler(_protocol); string host = GetHost(); _httpClient = new AblyHttpClient(host, _options.Port, _options.Tls, _options.Environment); ExecuteHttpRequest = _httpClient.Execute; InitAuth(this); }