DEV: tcploop: centralize the polling code into wait_for_fd()

There are multiple call places for poll(), let's first centralize them
to make it easier to enhance it. All callers now use the wait_for_fd()
function which was extended to take a timeout and which can return the
indication that an error was seen.
1 file changed