Python [Errno 98] Address already in use

前端 未结 9 2654
一个人的身影
一个人的身影 2020-11-27 10:35

In my Python socket program, I sometimes need to interrupt it with Ctrl-C. When I do this, it does close the connection using socket.close().

9条回答
  •  余生分开走
    2020-11-27 10:49

    run the command

    fuser -k (port_number_you_are _trying_to_access)/TCP
    

    example for flask: fuser -k 5000/tcp

    Also, remember this error arises when you interput by ctrl+z. so to terminate use ctrl+c

提交回复
热议问题