CoAPnet is a high performance .NET library for CoAP based communication. It provides a CoAP client and a CoAP server. It also has DTLS support out of the box.
MIT License
70
stars
15
forks
source link
New version of libraries not connecting to Tradfri #10
var connectOptions = new CoapClientConnectOptionsBuilder()
.WithHost(IP)
.WithPort(5684)
.WithDtlsTransportLayer(o => o.WithPreSharedKey(ID, secretKey))
.Build();
using (var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(taskTimout))) {
await theClient.ConnectAsync(connectOptions, cancellationTokenSource.Token);
}
}`
That works perfectly well when using the libs from version [1.0.9], but now that I upgraded to version [1.1.0] the same code is unable to connect. It now needs .ConfigureAwait(false); at the end.
Has something changed that I am missing? Or why could this be happening?
Is "ConfigureAwait(false)" really the only change to get it working?
What happens when there code is missing? Does it block forever or is there an exception?
So, I got this code to connect to an IKEA Tradri:
`public static async Task ConnectTradfri(ICoapClient theClient, string IP, string ID, string secretKey) { Console.WriteLine("< CONNECTING...");
That works perfectly well when using the libs from version [1.0.9], but now that I upgraded to version [1.1.0] the same code is unable to connect. It now needs .ConfigureAwait(false); at the end.
Has something changed that I am missing? Or why could this be happening?