port-for icon indicating copy to clipboard operation
port-for copied to clipboard

select_random fails because of wrong error returned in _refuses_connection

Open lecchri1 opened this issue 7 years ago • 1 comments

It returns error no 10035 which is Resource temporarily unavailable. It is the result for any attempts on available ports. Skipping _refuses_connection makes a successful connection. Tested on Windows 10 x64

lecchri1 avatar Feb 19 '18 13:02 lecchri1

The same thing on Windows Server 2019. Setting the timeout in https://github.com/kmike/port-for/blob/a798283c9a8d7203046f283955e1894566efefa7/src/port_for/api.py#L124 to a larger value (say 5 sec) fixes the issue. Can we change it from 1 to 5 sec in the code or make it configurable? Either option would be fine for me.

asavchkov avatar Feb 18 '22 04:02 asavchkov