polling with select.