コード例 #1
0
 public void SendResponse(Exchange exchange, Response response)
 {
     // Redirect the response to the HttpStack instead of a normal
     // CoAP endpoint.
     exchange.Request.Response = response;
     try
     {
         _server.ResponseProduced(exchange.Request, response);
         _server._httpStack.DoSendResponse(exchange.Request, response);
     }
     catch (Exception e)
     {
         if (log.IsWarnEnabled)
         {
             log.Warn("Exception while responding to Http request", e);
         }
     }
 }
コード例 #2
0
ファイル: ProxyHttpServer.cs プロジェクト: zpfcaca/CoAP.NET
 public override void SendResponse(Response response)
 {
     // Redirect the response to the HttpStack instead of a normal
     // CoAP endpoint.
     // TODO: When we change endpoint to be an interface, we can
     // redirect the responses a little more elegantly.
     try
     {
         _request.Response = response;
         _server.ResponseProduced(_request, response);
         _server._httpStack.DoSendResponse(_request, response);
     }
     catch (Exception e)
     {
         if (log.IsWarnEnabled)
         {
             log.Warn("Exception while responding to Http request", e);
         }
     }
 }