Quick answer: GameMaker TCP receiver crashing on large packets? Async network event fires once per arrival, not once per logical packet - buffer until the length prefix says you're complete.

Multiplayer state snapshot >8KB arrives in two pieces. Game asserts because the buffer reader hits EOF mid-message.

Length-prefix every packet

Send: buffer_write(b, buffer_u16, size); buffer_write(b, buffer_*, payload). Receive: keep accumulating; only consume bytes when you have the prefix's worth.

Per-client recv buffer

Maintain a separate buffer per client socket. Append on Async Networking event; consume from front when complete; buffer_resize to compact.

Avoid string null terminators

buffer_write_string writes a null-terminated C string. If your payload contains a null byte (binary data), it truncates. Use buffer_write with explicit length instead.

“TCP is a stream. Message boundaries are something you invent.”

Build a tiny test harness that sends 1MB across the loopback in 100 chunks. If your handler decodes correctly, real-world fragmentation will too.