Kacheong Poon wrote: > Garrett D'Amore wrote: > > >> Hmm... that seems wrong to me. I think you want it to block until at >> least one socket has an event on it. Otherwise you're back to select/poll. >> > > > The original idea is that the caller is expected to call > select()/poll()/port_getn() to form a list of read ready > sockets. So the read should not block for any of the > sockets. > > I think your idea above is different, which I think is to > remove the need to call select()/poll()/port_getn(). > Stephen also suggested something along this line. So it > is something like > > int recvfrom_list(struct rd_list[], size_t list_size, > int wait_time, int timeout); > > The caller just calls this function. This function will > wait at least wait_time and at most timeout or when all > the supplied socket buffers are filled in before returning. > On return, the caller goes through the rd_list and checks > which one has data. > > Is this what you meant? >
In a word, yes. Although, as has been pointed, it seems like this might not play well with other kinds of asynchronous event loops. So maybe using the separate poll/select/port_getn is better in that regard. -- Garrett _______________________________________________ networking-discuss mailing list networking-discuss@opensolaris.org