문제

As the title suggests, I'd like to know what is Java's equivalent (or most similar) function to C's poll() function for polling a set of file descriptors?

도움이 되었습니까?

해결책

As @EJP has commented above for java.nio.channels.Selector

A Selector supports key-based, non-blocking, multiplexed I/O. In other words, selectors enable you to perform I/O through multiple channels. Selectors are most applicable to socket-backed channels.

It is better to take a look at javadoc for java.nio.channels.Selector.

java.nio.channels.Selector

This is available since Java ( 7 ) 1.4 and later

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top