Python server “Only one usage of each socket address is normally permitted”

后端 未结 7 1078
野趣味
野趣味 2020-11-30 06:21

I\'m trying to create a very basic server in python that listens in on a port, creates a TCP connection when a client tries to connect, receives data, sends something back,

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 07:23

    On Windows, you can try these steps:

    1. check which process uses the port.

    # 4444 is your port number
    netstat -ano|findstr 4444
    

    you will get something like this:

    # 19088 is the PID of the process
    TCP    0.0.0.0:4444           *:*                                    19088
    

    2. kill this process

    With:

    tskill 19088
    

    Or:

    taskkill /F /PID 19088
    

    Good luck.

提交回复
热议问题