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,8 +313,13 @@ class Peer:
|
||||
return now - self.last_ping
|
||||
|
||||
def send_packet(self, data):
|
||||
self.srv.socket.sendto(data + StopPacket().marshal(),
|
||||
0, self.addr)
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user