def tos_sendto(self, ip, port):
"""Mimic the behavior of socket.sendto() with special behavior.
Note: Data is excluded from arguments since we encode our own.
Args:
ip: (str) destination IP address
port: (int) destination UDP port
Returns:
(int) the number of bytes sent on the socket
"""
return self.sendto(struct.pack(self.FORMAT, self.SIGNATURE, self._tos,
time.time() * 1000, 0, 0, False),
(ip, port))
评论列表
文章目录