Packet250CustomPayload(dk) contains a minor bug with sending data sizes of exactly 32767. It will create and send the packet just fine but the problem comes with reading the packet.
While creating the packet it checks if the length is greater than 32767. If you send data of exactly 32767 this passes. While reading it checks if the length is greater than 0 and less than 32767. It is now invalid.
This causes the packet to not read in the data portion of the packet and the remaining portion of the packet will now be read as a separate packet which usually causes the client to be disconnected