When select() returns how do I know which kind of notification has occured (readfds, writefds or exceptfds). In addtion which particular socket in the fdset array got the notification. Do I have to loop through all the sockets and check if data has arrived or data can be send?

Thanks