Advertisement

help for a newbie

Started by August 28, 2002 12:50 AM
2 comments, last by Neff 22 years, 5 months ago
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.
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()
Advertisement
Take a look at asynchronous sockets, they''re really great
Darkhaven Beta-test stage coming soon.
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.

This topic is closed to new replies.

Advertisement