PC_Nerd 0 Light Poster

Hi.


*** SHORT QUSETION:
Is there a way I can run a <large> socket server withought having to have a thread for each client/socket created?

***LONGER EXPLAINATION

IVe recently written a small network program, that sends messages over TCP or UDP... depending on user input. I want ot adapt that and another small game i made ( just a basic Tank OOP thing)... into a network game.

Mainly as an excersise for me i want to build this into a mini network game - however if I use TCP sockets, then I have to have a thread for each socket.. corrrect? So if ive got 100 people connected to my game (for example), then thats 101 threads isnt it?

Is there a way that I can get one socket ( or simply attach all of the sockets (ie, one socket for each person cnnected)), to <something> that will just continueally check for input, withought having to runhundreds of threads. Im looking at the server side here..... so the game isnt really that important, its managing all the threads.


Thanks in advance,
PC_NERD

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.