PDA

View Full Version : select || poll help index


emihaly
04-04-2003, 09:48 AM
hi,
i can use poll or select to monitor if i can read or write socket. But when it return list of sokcets, i must search full of my array of sokcet where is this socket.

Is possible use some better way? Like i put to socket, to select or poll with my index in array and select or poll return socket with index or only index(s). ?

Uzume
04-06-2003, 12:39 AM
Yes. It is possible, however, there is not highly portable way to do this. There are many newer poll style implementations that do some or all of that sort of thing (/dev/poll, /dev/epoll, and I am sure many others).

One of the ones I find very interesting ins this regard is Lemon's kqueue intereface. So far I know it is on later versions of FreeBSD and NetBSD. I believe someone made a patch for Linux as well but I do nto think it is in the main kernel code yet (maybe in the unstable development code--I have not checked).

In any event, nothing is widely standardized. The most standard interface by far is select and then perhaps poll.