我的代码是这样的:
while 1:
# Determine whether the server is up or down
try:
s.connect((mcip, port))
s.send(magic)
data = s.recv(1024)
s.close()
print data
except Exception, e:
print e
sleep(60)
它在第一次运行时运行良好,但之后每次都给我 Errno 9。我究竟做错了什么?
顺便提一句,
mcip = "mau5ville.com"
port = 25565
magic = "\xFE"