I have recently expanded my JAVA'ing from doing basic applets for my sites and such, into doing a lot of web based applications. I have been trying to figure out how to get multiple people to connect to a java server at once. I tried using threads, and thought I was on the right track, but i keep hitting dead ends. Any help would be great.
Not sure what you mean by a "Java server", but if they are web based applications, shouldn't a web server like Apache, with a Java/JSP application server like Tomcat, do the job?
Joined: Jan 29, 2003
If you're writing your own server - a fun and educational experience - you'll have a ServerSocket somewhere that does accept(). This gives you a socket that is connected to the client. If you put all processing of the socket on another thread, the main thread can be ready to accept another connection in no time at all. Here are few lines from my Wiki server ...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi