public MqttRpcClient(IMqttClient mqttClient, IMqttRpcClientOptions options) { _mqttClient = mqttClient ?? throw new ArgumentNullException(nameof(mqttClient)); _options = options ?? throw new ArgumentNullException(nameof(options)); _applicationMessageReceivedHandler = new RpcAwareApplicationMessageReceivedHandler( mqttClient.ApplicationMessageReceivedHandler, HandleApplicationMessageReceivedAsync); _mqttClient.ApplicationMessageReceivedHandler = _applicationMessageReceivedHandler; }
public async Task <IMqttRpcClient> ConnectRpcClientAsync(IMqttRpcClientOptions options) { return(new MqttRpcClient(await ConnectClientAsync(), options)); }