Is UDP packet payload size fixed?

Tahlil

How do I find out the current UDP packet payload size for a udp socket? Or is there any way to set it manually? I could not find any socket options related to that.

user207421

How do I find out the current UDP packet payload size for a udp socket?

There isn't such a thing.

Each datagram can have its own payload size, up to the maximum as determined by the outgoing socket's socket send buffer size, up to the absolute maximum dictated by the protocol, which is 65507 for IPv4. In practice the maximum recommended size through routers is 534 bytes.

The size of a received datagram is returned by recvfrom().

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related