Jump to content
  • Advertisement

Archived

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

MorningDeath

how will recvfrom act? (UDP)

This topic is 5885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!