Answer the question
In order to leave comments, you need to log in
Is it possible to read from multiple sockets in one thread?
Let's say there is an array of sockets and buffers where connections come after .accept() from another thread. In the loop I check if there is something in the buffer. If there is, I read it and send it to another thread for processing.
All this happens in java
So it is possible to make not to produce flows for each client?
Answer the question
In order to leave comments, you need to log in
See Selector from NIO. An analogue of the sish, allows the use of non-blocking sockets.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question