简体   繁体   中英

how to send UDP datagram larger than system buffer?

can any body here tell me how to send datagram larger than system buffer supplied to UDP socket in order to test the MSG_TRANC in C

and how i can get the size of the socket buffer ?

You could always increase the buffer size with the setsockopt function using the SO_SNDBUF flag.

Otherwise send (or sendto ) will normally block.

However, I would recommend you to try and rework your protocol so the packets fit inside the send buffer. You can always reassemble the packages when received (if you have proper sequencing of them).

What do you mean or want to to do?
I hope you read http://en.wikipedia.org/wiki/User_Datagram_Protocol

Are you attempting to send a datagram with total length greater than single packet size? Or is your send buffer used in building a packet too small?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM