Added select() to read, to avoid blocking
Merge branch 'use_select'