TCP: factor the poll() call