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
Currrently. the handling of the UDP sockets in pyduro is not thread safe. sending two Frames to the same burner from two different threads will result in an Address already in use error in on of them.
It would however be nicer f this feature was offered internally as part of pyduro instead. One possible solution would be to encapsulate the socket in a thread safe BurnerConnection class (internally using a threading.Lock). An instance of this class can then be passed to any Frame.send call instead of the connection details. This has the added benefit of reusing the socket for multiple calls rather than creating a new one for every call to Frame.send.
The text was updated successfully, but these errors were encountered:
Currrently. the handling of the UDP sockets in pyduro is not thread safe.
send
ing twoFrame
s to the same burner from two different threads will result in anAddress already in use
error in on of them.I resorted to explicitly using a
threading.Lock
in my application to work around this: https://github.com/freol35241/aduro2mqtt/blob/main/main.py#L51It would however be nicer f this feature was offered internally as part of pyduro instead. One possible solution would be to encapsulate the socket in a thread safe
BurnerConnection
class (internally using athreading.Lock
). An instance of this class can then be passed to anyFrame.send
call instead of the connection details. This has the added benefit of reusing the socket for multiple calls rather than creating a new one for every call toFrame.send
.The text was updated successfully, but these errors were encountered: