Example #1
0
 protected override void DoGet(CoapExchange exchange)
 {
     // Accept the request to promise the client this request will be acted.
     exchange.Accept();
     
     // ... and then do nothing. Pretty mean...
 }
Example #2
0
        protected override void DoGet(CoapExchange exchange)
        {
            // Accept the request to promise the client this request will be acted.
            exchange.Accept();

            // Do sth. time-consuming
            Thread.Sleep(2000);

            // Now respond the previous request.
            Response response = new Response(StatusCode.Content);
            response.PayloadString = "This message was sent by a separate response.\n" +
                "Your client will need to acknowledge it, otherwise it will be retransmitted.";

            exchange.Respond(response);
        }
Example #3
0
 protected override void DoPost(CoapExchange exchange)
 {
     exchange.Accept();
     exchange.Respond(SERVER_RESPONSE);
 }