Archived

This topic is now archived and is closed to further replies.

MorningDeath

how will recvfrom act? (UDP)

Recommended Posts

lets say i send packet 32 bytes long, but i tell recvfrom function to read 64 bytes... will it recieve only 32 bytes - send packet size or function will wait for another packet and give me that 64 bytes? in other words: does recvfrom read always one packet?

Share this post


Link to post
Share on other sites
This doesn''t really depend on the function you use, but on the type of socket you use. Since recvfrom() really only makes sense with UDP (packet-oriented) sockets, you''ll get exactly one packet back. If that packet is 32 bytes long, and your receive buffer is 64 bytes, you''ll get 32 bytes back.

This is really, really a matter of what kind of socket you''re using. In a packet-oriented situations, you get back packets, and that''s it.

cu,
Prefect

Share this post


Link to post
Share on other sites