How to send message with size>32kb ? (9 posts)

  • Profile picture of phate666 phate66670p said 8 months, 4 weeks ago:

    Is there an easy way to send messages with size>32k ?
    As the length of the messages is encoded in a short, messages cant be longer than 32.767 bytes

  • Profile picture of KuroSei KuroSei15p said 8 months, 4 weeks ago:

    You split the message and use a adapted protocol.

  • Profile picture of pspeed pspeed815p said 8 months, 4 weeks ago:

    Yep, what he said.

    It’s a tradeoff because of the way Serializer works.

  • Profile picture of phate666 phate66670p said 8 months, 4 weeks ago:

    Ok, i will switch to KryoNet then, it supports variable message length and has built-in compression

  • Profile picture of pspeed pspeed815p said 8 months, 4 weeks ago:

    Compression is not hard to support… there is already a GZIPMessage type that only doesn’t work because of a quirk in the API conversion I did.

    Variable message length is harder though because of the way Serializer is architected. I really want to rewrite it someday but that’s a sizable effort. I’d really like something based on bit streams, personally. Because Serializer uses ByteBuffer to write messages, it needs some maximum size allocated before the message can even be serialized. A pain and sort of the root of the size limitation.

  • Profile picture of shirkit shirkit20p said 7 months, 1 week ago:

    Hey, you know most routers that connects two peers only accepts messages at the maximum of 1500 bytes. That’s over the ethernet protocol. Are you sure of what you are doing?

  • Profile picture of normen normen1290p said 7 months, 1 week ago:

    The 1500 bytes max is at a lower level.

  • Profile picture of pspeed pspeed815p said 7 months, 1 week ago:

    Yeah, the MTU is a lower level. It does affect throughput, though. For example, a UDP packet that exceeds the MTU is more likely to be dropped/lost since ethernet has to reconstruct the full packet on the other end. So while 100% of 100 byte UDP messages might get there, statistically it’s very likely that many 32k UDP packets get lost.

    …but most of us shouldn’t worry about that most of the time.

  • Profile picture of shirkit shirkit20p said 7 months, 1 week ago:

    Just saying because if you expect that a 32kb message arrives at the same time of a 1.5kb, then don’t.