You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to ask if there is any scenario that handleIncomingRequest is called for client side?
It seems that function purpose is to handle requests (eg. GET) on server side. Am I right?
However handleIncomingRequest is checking self.responseCallback which is for client side.
If Coap can act as an server and client in a single instance (can't it?) and if self.responseCallback is set and if requested url is unknown (not in self.callbacks) then the function returns False and sendResponse indication "not found" is not called.
ifurlCallbackisNone:
ifself.responseCallback:
# The incoming request may be a response, let the responseCallback handle it.returnFalseprint('Callback for url [', url, "] not found")
self.sendResponse(sourceIp, sourcePort, requestPacket.messageid,
None, macros.COAP_RESPONSE_CODE.COAP_NOT_FOUND,
macros.COAP_CONTENT_FORMAT.COAP_NONE, requestPacket.token)
So my point is that either handleIncomingRequest shall not be called for non requests (ie. GET) or above logic shall be changed to exclude server requests:
ifself.responseCallbackandmacros.COAP_METHOD.COAP_GET!=requestPacket.method:
# The incoming request may be a response, let the responseCallback handle it.returnFalse
Please share your thoughts.
Best regards
The text was updated successfully, but these errors were encountered:
Hello,
I'd like to ask if there is any scenario that
handleIncomingRequest
is called for client side?It seems that function purpose is to handle requests (eg. GET) on server side. Am I right?
However
handleIncomingRequest
is checkingself.responseCallback
which is for client side.If
Coap
can act as an server and client in a single instance (can't it?) and ifself.responseCallback
is set and if requested url is unknown (not inself.callbacks
) then the function returnsFalse
andsendResponse
indication "not found" is not called.So my point is that either
handleIncomingRequest
shall not be called for non requests (ie. GET) or above logic shall be changed to exclude server requests:Please share your thoughts.
Best regards
The text was updated successfully, but these errors were encountered: