The IBM Watson IoT C# library use the same package :) https://github.com/ibm-watson-iot/iot-csharp
The library is amazing. However a few suggestions from my side:
- The documentation is very generic, not explaining the complex scenarios.
- The error codes are very generic and the documentation doesn't cover what the return error code number means.
var serverCert = new X509Certificate("certificte path *.cer");
//I exported the certificate from the server and stored in a project folder.
_client = new MqttClient("Host name", "port", true, serverCert, null - if you use client certificate, MqttSslProtocols.TLSv1_2);
if (_client.Connect("Client name", "user name", "password") != 0)
{
throw new Exception("Unable to establish connection to MQTT broker");
}
No comments:
Post a Comment