O'Reilly logo

Mastering Internet of Things by Peter Waher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a CoAP endpoint

Since directionality in CoAP is not as stringent as in HTTP, the same class is used for both clients and servers, both named endpoints to make things simpler. We add a CoapEndpoint field (defined in the Waher.Networking.CoAP namespace) for our endpoint:

private CoapEndpoint coapEndpoint = null; 

To start using CoAP, we begin by creating an unencrypted CoAP endpoint using the default port number (5683):

this.coapEndpoint = new CoapEndpoint(); 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required