i m writing simple application involving a server and many clients at time. i have to use DataGramSocket. application is simple exchange of messages through console like in chatting. but both operations in.readLine() and ds.receive() are blocking and putting them in seperate threads didn’t help as blocking i/o will block the thread too. can any body tell me how can i do that without nio
Share
If you have threads which are dedicated only to sending or receiving data over network, then thread blocking won’t be a problem, as only that dedicated thread will be blocked.
Then, let’s consider impact of this solution on number of threads in your application:
If you interested in general task of handling lots of clients, here is the classic web paper on this question.