private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
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 preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
private void preparePollFds() { int i = 1; // Our wakeup pipe comes before all the user's fds. for (SelectionKeyImpl key : mutableKeys) { int interestOps = key.interestOpsNoCheck(); short eventMask = 0; if (((OP_ACCEPT | OP_READ) & interestOps) != 0) { eventMask |= POLLIN; } if (((OP_CONNECT | OP_WRITE) & interestOps) != 0) { eventMask |= POLLOUT; } if (eventMask != 0) { setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key); } } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }
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(); } }