Java, problem sending a message with socket connection?

Your bi-directional message passing mechanism should look something like this.

Your bi-directional message passing mechanism should look something like this: Server: Wait on any client InputStream if (broadcast) broadcast_message() else process_message() Client: Receiving Thread: Wait on server broadcast Sending Thread: Wait on messages to be sent to server from the User Input This should do the trick :) Hope it helps. Cheers!

I can't write the server in this way, since the broadcast message isn't sent after an InputStream. I tried to organize the client as you suggested, creating a new Thread to wait for the broadcast message, but the bufferedreader is messed up (my idea was to read from the same input stream on two different bufferedreader, but it doesn't work). Maybe I should try using mutex for this purpose.

– Simon May 16 at 18:56 Done with a thread which constantly listen to the server. Using an if(bufferedreader.isReady()) and reading the answer each 3 seconds, the communication work properly. Anyway, thanks for giving me the idea of using two different threads!

:) – Simon May 17 at 1:54 Glad that you managed to get things working and I'm always glad to help! Cheers! – Vern May 17 at 6:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions