OSError [Errno 99] - python

前端 未结 2 1997
感情败类
感情败类 2021-01-22 10:17

i want to execute the following simple server code:

import socket

s = socket.socket()         # Create a socket object
host = socket.gethostname() # Get local          


        
2条回答
  •  遥遥无期
    2021-01-22 10:49

    Try set the SO_REUSEADDR option to the socket:

    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    

提交回复
热议问题