Programming Tips - Programming: How to read multiple sockets from one thread
Date: 2015jul20
Update: 2026jul3
Language: C/C++, Java
Q. Programming: How to 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 Socket's.
- Then use a Selector on the Channel's.