I've been trying to do some client/server programming in Java ... I've 
done it before in perl a while back, but nowadays Java is what I'm messing 
with.

I'm trying to write a server where multiple clients can connect and 
communicate with each other through the server. So far I'm able to do this 
using multiple threads etc., but the problem is that the server sits on 
one thread waiting for a command from one client (using "readLine()" from 
the BufferedReader/InputStreamReader from the Socket that Java gives you). 

Now, what happens if the other client sends a command? I want the server 
to send that information to the first client, but it can't, because it's 
still waiting there at the readLine() statement, and can't proceed until 
the first client sends some command.

Is there a way to allow real-time communication without using polling or 
multiple threads per client (i.e. have each client open a "read" 
connection to the server, and a "write" connection to the server as well)?

Does any of this make sense at all?

  ~ross

-- 

This sentence would be seven words long if it were six words shorter.


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to