1. Yes you can use select in command line based programs.

2. Of course you can have a message loop, it will appear with each select timeout.

3. Please look at a simple server example in the BeeJ's guide: http://cboard.cprogramming.com/showthread.php?t=79360