private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
int flags = Libcore.os.fcntlVoid(fd, F_GETFL); if (timeout > 0 && (flags & O_NONBLOCK) == 0) { StructPollfd pfd = new StructPollfd(); pfd.fd = fd; pfd.events = (short) (POLLIN | POLLERR);
public SelectorImpl(SelectorProvider selectorProvider) throws IOException { super(selectorProvider); /* * Create a pipe to trigger wakeup. We can't use a NIO pipe because it * would be closed if the selecting thread is interrupted. Also * configure the pipe so we can fully drain it without blocking. */ try { FileDescriptor[] pipeFds = Libcore.os.pipe(); wakeupIn = pipeFds[0]; wakeupOut = pipeFds[1]; IoUtils.setBlocking(wakeupIn, false); pollFds.add(new StructPollfd()); setPollFd(0, wakeupIn, POLLIN, null); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
private void ensurePollFdsCapacity() { // We need one slot for each element of mutableKeys, plus one for the wakeup pipe. while (pollFds.size() < mutableKeys.size() + 1) { pollFds.add(new StructPollfd()); } }
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
public static boolean isConnected(FileDescriptor fd, InetAddress inetAddress, int port, int timeoutMs, int remainingTimeoutMs) throws IOException { ErrnoException cause; try { StructPollfd[] pollFds = new StructPollfd[] { new StructPollfd() }; pollFds[0].fd = fd; pollFds[0].events = (short) POLLOUT;
int flags = Libcore.os.fcntlVoid(fd, F_GETFL); if (timeout > 0 && (flags & O_NONBLOCK) == 0) { StructPollfd pfd = new StructPollfd(); pfd.fd = fd; pfd.events = (short) (POLLIN | POLLERR);
public SelectorImpl(SelectorProvider selectorProvider) throws IOException { super(selectorProvider); /* * Create a pipe to trigger wakeup. We can't use a NIO pipe because it * would be closed if the selecting thread is interrupted. Also * configure the pipe so we can fully drain it without blocking. */ try { FileDescriptor[] pipeFds = Libcore.os.pipe(); wakeupIn = pipeFds[0]; wakeupOut = pipeFds[1]; IoUtils.setBlocking(wakeupIn, false); pollFds.add(new StructPollfd()); setPollFd(0, wakeupIn, POLLIN, null); } catch (ErrnoException errnoException) { throw errnoException.rethrowAsIOException(); } }
int flags = Libcore.os.fcntlVoid(fd, F_GETFL); if (timeout > 0 && (flags & O_NONBLOCK) == 0) { StructPollfd pfd = new StructPollfd(); pfd.fd = fd; pfd.events = (short) (POLLIN | POLLERR);
int flags = Libcore.os.fcntlVoid(fd, F_GETFL); if (timeout > 0 && (flags & O_NONBLOCK) == 0) { StructPollfd pfd = new StructPollfd(); pfd.fd = fd; pfd.events = (short) (POLLIN | POLLERR);