Interface AprSocketContext.NonBlockingPollHandler

  • All Superinterfaces:
    AprSocketContext.BlockingPollHandler
    Enclosing class:
    AprSocketContext

    public static interface AprSocketContext.NonBlockingPollHandler
    extends AprSocketContext.BlockingPollHandler
    Additional callbacks for non-blocking. This can be much faster - but it's harder to code, should be used only for low-level protocol implementation, proxies, etc. The model is restricted in many ways to avoid complexity and bugs: - read can only happen in the IO thread associated with the poller - user doesn't control poll interest - it is set automatically based on read/write results - it is only possible to suspend read, for TCP flow control - also only from the IO thread. Resume can happen from any thread. - it is also possible to call write() from any thread
    • Method Detail

      • connected

        void connected​(AprSocket ch)
        Called after connection is established, in a thread pool. Process will be called next.
      • error

        void error​(AprSocket ch,
                   Throwable t)
        Before close, if an exception happens.