java - How to wait in a thread until some data is available in another thread -


i trying add tcp server application. application generates data time time. want send generated data clients connected server new data generated.

so far, have created serversocket in separate thread busy waits client connections. when new client connected, new thread spawned socket, busy reads data received socket.

what cant figure out is, how can wait in per client spawned thread until data generated in app. in current situation, thread stuck until new data arrived client because busy waits data client. don't want force clients send data periodically new data generated in app. want send data genrated.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -