INNER CODE UNIT · Python

can_send_udp

TheXTech/TheXTech · resources/_dev_scripts/xserver.py:607

                can_send_udp = (client.udp_dest and len(self.sent_history) - client.acked_to <= MTU_size - 8)
                if can_send_udp and (client.udp_okay or client.udp_transmissions < 16):
                    start = max(client.acked_frame, client.tcp_sent_frame + 1)
                    if start >= 0:
                        ack = bytes([MESSAGE_TRANSMIT_START, start // (256 * 256), (start // 256) % 256, start % 256])
                    else:
                        ack = bytes()
                    client.udp_send = ack + self.sent_history[client.acked_to:] + bytes([MESSAGE_FRAME_END, self.frame_no // (256 * 256), (self.frame_no // 256) % 256, self.frame_no % 256])
                    client.udp_transmissions += 1

                # add the tail of the room history to the TCP send queue
                if not can_send_udp or not client.udp_okay:
                    if client.tcp_send_start == client.tcp_send_end:
                        client.tcp_send_start = client.acked_to
                    client.tcp_send_end = len(self.sent_history)
                    client.acked_to = client.tcp_send_end
                    client.tcp_sent_frame = self.frame_no
                    if not can_send_udp:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…