| | |
Socket Server for game - too many threads?
![]() |
•
•
Join Date: Mar 2008
Posts: 27
Reputation:
Solved Threads: 0
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
*** 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
![]() |
Other Threads in the Python Forum
- Previous Thread: Append Results to ListBox
- Next Thread: Search and replace with re:compile(....)
| Thread Tools | Search this Thread |
abrupt ansi anti apache application approximation array assignment backend beginner binary bluetooth builtin calculator character converter countpasswordentry curved customdialog dan08 decimals dictionary dynamic edit exe file float format function gnu graphics heads homework http ideas inches input java leftmouse library line lines linux list lists loop module mouse movingimageswithpygame mysqlquery number numbers numeric output parsing path phonebook pointer prime programming progressbar push py2exe pygame python random recursion redirect remote reverse schedule scrolledtext session software sqlite statictext statistics string strings sudokusolver syntax terminal text thread threading time tlapse tuple twoup ubuntu unicode unit urllib urllib2 variable wikipedia wordgame write wxpython xlib





