Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody, :)

I'm developing multi client server application with java clients and ruby server and I need to listen to the message that sent by the server and updates the clients according to this messages with out using loops like while(true) to listen to socket messages ,

so i need to use action listener for sockets if its found to notify me if there is new message coming from the server then i will read this message and update the clients .

can anyone can help me or if there is any alternative way to solve this problem. :)


Thanks in advance:rose:
Posted

1 solution

[Please elaborate the question if there is more information]

Working on the assumption that your server is publishing fine to all the clients, it is the connection at the client end that needs to listen.

I would put your Socket in its own thread so that it does not lock the UI, then just listen on the inbound stream.

have a look here[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900