This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Server/Client problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Server/Client problem" Watch "Server/Client problem" New topic

Server/Client problem

jim delmar

Joined: Feb 02, 2012
Posts: 1
Hello guys!! New one here. I hava a problem with my code.
Here 's the server code

and here is the client's

So i make a server who waits for connections.When a client connects, if we(the server) send the command showinfo, it responds with some system information.The problem is that it is a multithreaded server and many clients connect.So if for example connect 2 clients at the server we have to type 2 times showinfo and then the clients give us the information. How can i make the clients respond immediately with typing showinfo for each one and don't wait until i type showinfo for all the clients. It's a bit tiring to type 50 times showinfo if there are 50 clients before you can execute your command. Thank you in advance (i have tried some thread synchronization and some sleep() join() commands but i haven't reach a conclusion i hope you can help a bit.)
I agree. Here's the link:
subject: Server/Client problem
jQuery in Action, 3rd edition