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
If a service is provided on both UDP and TCP port, this info can not be handled correctly in self._offered_services. So I think we need to add a condition to make sure the provided service has the same protocol with the Client Service Instance, either TCP or UDP.
Before
# At this point the service should be found since an exception would have been raised before
for s in self._offered_services:
if s.service_id == self._service.id and s.instance_id == self._instance_id:
dst_address = str(s.endpoint[0])
dst_port = s.endpoint[1]
break
After
for s in self._offered_services:
if (
s.service_id == self._service.id
and s.instance_id == self._instance_id
and s.protocol == self._protocol
):
dst_address = str(s.endpoint[0])
dst_port = s.endpoint[1]
break
By the way, the snippets in the call_method, which specifies the UDP condition seems to be duplicated.
# In case of UDP, just send out the datagram and wait for the response
# At this point the service should be found since an exception would have been raised before
for s in self._offered_services:
if (
s.service_id == self._service.id
and s.instance_id == self._instance_id
):
dst_address = str(s.endpoint[0])
dst_port = s.endpoint[1]
break
The text was updated successfully, but these errors were encountered:
If a service is provided on both UDP and TCP port, this info can not be handled correctly in self._offered_services. So I think we need to add a condition to make sure the provided service has the same protocol with the Client Service Instance, either TCP or UDP.
Before
After
By the way, the snippets in the call_method, which specifies the UDP condition seems to be duplicated.
The text was updated successfully, but these errors were encountered: