mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-10 21:55:11 +01:00
Split packets in 4096 byte chunks
This commit is contained in:
parent
b919f9cf95
commit
bb3fbc0fb2
@ -313,9 +313,14 @@ class Peer:
|
||||
return now - self.last_ping
|
||||
|
||||
def send_packet(self, data):
|
||||
self.srv.socket.sendto(data + StopPacket().marshal(),
|
||||
all_data = data + StopPacket().marshal()
|
||||
|
||||
for i in range(0, len(all_data), 4096):
|
||||
cur = all_data[i : min(i + 4096, len(all_data))]
|
||||
self.srv.socket.sendto(cur,
|
||||
0, self.addr)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return '%s:%d "%s" %d %d' % (self.public_ip, self.public_port,
|
||||
self.name, self.key, self.is_master)
|
||||
|
Loading…
Reference in New Issue
Block a user