[Java] Server Multithreading
So basically, I've been working on a 2p matchbased game (using JMonkey for a lot of it) for my programming class for about a month now (I try to impress with my projects xD) and I'm trying to work out the best way to handle clients. The basic structure I had been planning on was just have everything in one thread, and just figure out a way of grouping each pair of clients (2D array possibly, using match IDs as the array indices) to handle them. However, I was wondering if it would be better to just set up a new thread for each match. The only real issue I have with this approach is that from what I've heard, you don't really want to stack up a gazillion threads, and a good rule of thumb is to cap it at the 4-8 threads. Any ideas/suggestions/tips?
Re: [Java] Server Multithreading
If you wish to avoid threading you should look into asynchronous sockets, google it for a better explanation.
Re: [Java] Server Multithreading
i kno not everything about java and i think u need a computre w/ multi threads and put a user in each thread.