def addresss2nicestring(address):
#address is a (str,port) tuple from socket.recvfrom() or socket.getpeername()
#output is something nice such as "192.0.2.7" or "2001:0db8:1::7"
if address!=None:
return address[0]
else:
return None
评论列表
文章目录