chkr1011 / CoAPnet

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

Example Client has an error? #5

Closed gkapellmann closed 3 years ago

gkapellmann commented 4 years ago

Hello,

In the example, it says to create a connection the builder is setup as:

var connectOptions = new CoapClientConnectOptionsBuilder() .WithHost("GW-B8D7AF2B3EA3.fritz.box") .WithPort(5684) .WithDtlsTransportLayer(new DtlsCoapTransportLayerOptionsBuilder() .WithPreSharedKey("IDENTITY", "lqxbBH6o2eAKSo5A") .Build()) .Build();

However, when the package is downloaded from the nuget link, yhis line doesnt seem to be accepted:

.WithDtlsTransportLayer(new DtlsCoapTransportLayerOptionsBuilder()

And Visual studio only seems to find:

.WithTransportLayer

How will the example be setup in this case?

Thank you!

chkr1011 commented 3 years ago

Hi, sorry for the long delay. I updated the sample because this API was changed in the meantime.

gkapellmann commented 3 years ago

No worries! Ok, thank you!

Awesome libs btw :)