The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Second command to socket doesn't get through

Hi there,

My application works as a client/server architecture where I send commands to a server through sockets which are then initialized and executed to a Server class and finally a CPU class.
The Server class initializes the CPU class and the CPU class initializes the CPU utilization.

When i send the start commando the Server class creates a new thread for the CPU class which start the CPU utilization.
This all works fine. My problem arises when I want to stop the thread by sending a stop command trough the socket. Is doesn't initialize.

Re: Second command to socket doesn't get through

What I'd do to find the problem is add lots of println statements to show the execution flow and to show the values of variables as they change. The print outs will help you understand what the code is doing so you can find where it is going wrong.

Re: Second command to socket doesn't get through

I have a JSP page and clien class which interact with eachother.
You can start the JANEServer class which creates a serversocket on port 20000 on the localhost.
The JANEServer is included in the reply:JANEServer_20110826-2.zip

If you have Tomcat installed you can use the war-file attached and execute JANEClient.jsp.
The war-file is renamed to zip to be able to post in the reply. Just rename is to JANEClient.war