> > + i++; > > + established_socks[i] = accept_from_one(server_fds, > > + server_fds_len); > > I am not sure the final ack is always received by the server at this point. > If not, the test could be flaky. Is this case possible? and is it better to > poll/select for a fixed number of seconds? Fair point. It definitely seems like a potential source of flakiness. Using poll with a timeout sounds reasonable to me. I think this eliminates the need for setting the O_NONBLOCK flag as well, which is nice. I'll make some adjustments and send out another version. Thanks for catching this! Jordan