Dave's Brain

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

Date: 2015jul20

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.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.