def sendto(self, msg, address):
self.lg.info("{} - [{}] -> {}".format(self.sock.getsockname(), \
msg, \
address))
try:
return self.sock.sendto(msg, socket.MSG_DONTWAIT, address + "_udp")
except ConnectionRefusedError:
self.lg.error("simulator_stuff.sendto: the message {} has not been delivered because the destination {} left the team".format(msg, address))
raise
except KeyboardInterrupt:
self.lg.warning("simulator_stuff.sendto: send_packet {} to {}".format(msg, address))
raise
except FileNotFoundError:
self.lg.error("simulator_stuff.sendto: {}".format(address + "_udp"))
raise
except BlockingIOError:
raise
评论列表
文章目录