Jump to content
  • Advertisement

Archived

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

Neff

help for a newbie

This topic is 5803 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 still hazy on exactly how WinSock works. I thought it would be cool to write a little chat server, and a little chat client program. I just want simple, basically all in a console. But as for the server, I want to be able to tell if someone wants to join my chat server. It seems that the accept function, or whatever crucial part of someone connecting, blocks program flow, thus stopping the chat. Should the server be a win32 application with the custom message handling? If this were to be a major processing thing, would it be better for it to be console? I am still confused, and any help would be nice. I have looked at many tutorials, but I will reread and reread until I can do this. Thanks for your time! - Be the change you want to see in the world.

Share this post


Link to post
Share on other sites
Advertisement
You could make the server socket non-blocking. Then if there are no connections pending, the accept call will return immediately with WSAEWOULDBLOCK (I think).
You can make a socket nonblocking with ioctlsocket()

Share this post


Link to post
Share on other sites
http://www.digitalsentience.pwp.blueyonder.co.uk/CNetConnect.zip

i wrote something like what you''re after. the server listens for users constantly and passes mesages to whoever is connected.

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.

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!