OSError: [WinError 10038] An operation was attempted on something that is not a socket 服务端的conn.close()写在while循环的外部,不然关闭连接之后会重新连接。 或者当写在while True中时,执行完之后break: while True: ... ... conn.close() break #continue do somethins