Closed dennisjlee closed 1 month ago
My use case was to create three NewportXPS instances and access them from different threads:
When I initially tried this without my patch, each time I made a NewportXPS object, it would create an XPS, which would reset XPS.__nbSockets
and XPS.__usedSockets
, so each NewportXPS object would have _sid == 0
and would end up trying to communicate using the same socket.
With this patch, the three NewportXPS objects get _sid = 0
, _sid = 1
, _sid = 2
as expected, and they can all communicate successfully using separate sockets.
@dennisjlee Thanks! I'm sort of surprised that I never hit this before ;).
This allows creating multiple NewportXPS objects in one process and accessing them from different threads (each with their own unique socket and XPS object).