[Object API] WinError 10048
Issue
I get this error when working with the Object API:
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted.What can I do?
Solution
The message occurs when the Object API opens many short-lived TCP sockets on Windows and runs out of free (ephemeral) ports.
You can try two approaches to fix it:
Either insert wait times between Object API calls or adjust MaxUserPort and TcpTimedWaitDelay in the registry.
For the first approach it can be enough to insert a sleep for more than 5 ms at critical points. That should be a quick fix.
For the second approach you will need admin rights to edit the registry values. Please take a look at this article on stack overflow as well: On Windows shows an error message "socket re-usage" though there is no intend to do so