Browse - Programming Tips - How can I read multiple sockets from one thread?

Date: 2015jul20
Language: C/C++, Java

Q.  How can I read multiple sockets from one thread?

A.  

In C/C++ on Linux:

- use poll().
- select() is the old way.

In Java:

- Use channel's instead of sockets.
- Then use a Selector on the channels.