More than 64 Winsock Sockets?...

Hey... I am working with Sockets at the moment to create a small chat program.

But i read about a limitation of the number of sockets supported by Winsock...
http://msdn.microsoft.com/en-us/library/ms739169(VS.85).aspx

My question is, wether i should increase the supported socket number described in the article. Or maybe use another Protocoll/Solution etc...

Any suggestions?
IIRC, you can have more than one connection open on a single socket, so what does it matter?
Woah, why so many sockets?

Typically, a message socket is created, used, then destroyed. Only listener sockets are persistent. Hence, your chat should work something like this:

server
receive user validation (login) request -- respond with cookie or reject
receive user message (cookie + text) request -- replicate text to all logged-in users
receive user logout request -- cookie no longer valid, user removed from logged-in user list

client
send login request (containing user name) -- receive cookie or rejection
send message (cookie + text)
receive message (text)
send logout request

In both the server and the client, you will have to set up a listener socket that accepts connections to the program, performs the above on the new connection, then closes the new connection; and continues to listen for more connections.


Now, I'm no expert in this field -- so there could easily be other ways to do this...
though 64 sockets are too much to work as posted above.. but still to increase the socket count you can set

FD_SETSIZE before including winsock.h file or compile with -DFD_SETSIZE option.

@write... thats what is in the article...

i think i prefer duoas´s and helios´ solution...
yes thats what i said.. i will go with what the above posts said..

i was just replying to your post subject line.. :)
Topic archived. No new replies allowed.