Jump to content
  • Advertisement
Sign in to follow this  
Khaos Dragon

recv causes program to crash

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

I am having a problem with the winsock library, but I think it may fall in the realm of general programming as I know how to use winsock and don't need any help with network programming. Anyways, I find that I can use recv just fine on my console client. However on my sdl/opengl/openal client, the program will freeze the moment I call recv. Currently I only call it once, I pull only 1 byte of data to be safe (so its not a memory violation), and I don't even touch the data afterwards...should work right? wrong... If anybody has a clue what is going on, it would really really be appreciated. This is a stupid problem in my opinion which makes no sense as to why it should happen, and it is really getting in the way of my 3d network programming. edit: could it possibly be a conflict with sdl, opengl, openal, or for that matter the other libraries I used which are glew, sdl_image, and sdl_ttf?

Share this post


Link to post
Share on other sites
Advertisement
recv() blocks and waits for data to arrive if theres none pending. Either set your socket to non-blocking mode, or use select() to see if theres data to read.

Share this post


Link to post
Share on other sites
ahh sorry, I feel stupid....

My console version of the client "appeared" to be working because I was not outputting info each frame in order to check if it was moving to the next frame...

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!