Jump to content
  • Advertisement
Sign in to follow this  
programmer_tom

Socket Issue

This topic is 2687 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

Hey All

I'm pretty new to socket programming in c++, but i've managed to get a client/server thing going pretty well after a few days.

Everything is all hooked up and I'm sending packets both ways fine in general.

As a test, I tried sending 100 messages at once using send() and recv(), and it looks like I'm getting about half of them
to the other side.

What's the story with ACKing or whatever I need to do to be able to spam messages and guarantee their arrival?

-tom

Share this post


Link to post
Share on other sites
Advertisement

What's the story with ACKing or whatever I need to do to be able to spam messages and guarantee their arrival?


That depends on what your requirements are. They may be:

It's OK to lose some packets or receive some packets out of order, as long as most of them make it across as fast as possible. This is UDP.
It's OK to wait a little bit now and then, as long as all of the packets make it across in order. This is TCP.

Very seldom will you need any other guarantee. If you do, it's typically of the kind "I guarantee that most packets make it, but if some packet make it out of order, I drop it," which you can implement on top of UDP using a sequence counter.

Share this post


Link to post
Share on other sites
hey thanks for the reply

ya TCP is fine here.

after looking at it more, looks like when I'm calling recv(), i'm blindly assuming there's one message there.

when i crank msgs fast from the server, that's not the case.

gonna look at building a smarter read().

-tom

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!