optimised check_windows_port.py
optimized the code
1. 'with' statement : It will ensures the socket is properly closed
2. Timeout and address reuse are still there but cleanly contained.
3. Input validation: Catches the bad input early.
4. Function separation: Makes it faster and clearer to reuse or extend.
5. Minimal memory footprint and fast termination due to better structure.
合并状态:未合并 0 条评论