private Selectable timerSelectable() { Selectable sel = selectable(); sel.setChannel(wakeup.source()); sel.onReadable(new TimerReadable()); sel.onExpired(new TimerExpired()); sel.onFree(new TimerFree()); sel.setReading(true); sel.setDeadline(timer.deadline()); update(sel); return sel; }
private Selectable timerSelectable() { Selectable sel = selectable(); sel.setChannel(wakeup.source()); sel.onReadable(new TimerReadable()); sel.onExpired(new TimerExpired()); sel.onFree(new TimerFree()); sel.setReading(true); sel.setDeadline(timer.deadline()); update(sel); return sel; }
protected static Selectable selectableTransport(Reactor reactor, Socket socket, Transport transport) { Selectable selectable = reactor.selectable(); selectable.setChannel(socket != null ? socket.getChannel() : null); selectable.onReadable(connectionReadable); selectable.onWritable(connectionWritable); selectable.onError(connectionError); selectable.onExpired(connectionExpired); selectable.onFree(connectionFree); ((SelectableImpl)selectable).setTransport(transport); ((TransportImpl)transport).setSelectable(selectable); ((TransportImpl)transport).setReactor(reactor); update(selectable); reactor.update(selectable); return selectable; }
protected static Selectable selectableTransport(Reactor reactor, Socket socket, Transport transport) { Selectable selectable = reactor.selectable(); selectable.setChannel(socket != null ? socket.getChannel() : null); selectable.onReadable(connectionReadable); selectable.onWritable(connectionWritable); selectable.onError(connectionError); selectable.onExpired(connectionExpired); selectable.onFree(connectionFree); ((SelectableImpl)selectable).setTransport(transport); ((TransportImpl)transport).setSelectable(selectable); ((TransportImpl)transport).setReactor(reactor); update(selectable); reactor.update(selectable); return selectable; }