Class ServerSocketAccept.AcceptCallback

  • All Implemented Interfaces:
    java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>
    Enclosing class:
    ServerSocketAccept

    protected static class ServerSocketAccept.AcceptCallback
    extends java.lang.Object
    implements java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>
    A CompletionHandler implementation that receives the result of an asynchronous accept and processes the request with an asynchronous coroutine execution.
    • Constructor Summary

      Constructors 
      Constructor Description
      AcceptCallback​(Coroutine<java.nio.channels.AsynchronousSocketChannel,​?> requestHandler, Suspension<java.lang.Void> suspension)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void completed​(java.nio.channels.AsynchronousSocketChannel requestChannel, java.lang.Void ignored)  
      void failed​(java.lang.Throwable error, java.lang.Void ignored)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AcceptCallback

        public AcceptCallback​(Coroutine<java.nio.channels.AsynchronousSocketChannel,​?> requestHandler,
                              Suspension<java.lang.Void> suspension)
        Creates a new instance.
        Parameters:
        requestHandler - The coroutine to process the request with
        suspension - The suspension to resume after accepting
    • Method Detail

      • completed

        public void completed​(java.nio.channels.AsynchronousSocketChannel requestChannel,
                              java.lang.Void ignored)
        Specified by:
        completed in interface java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>
      • failed

        public void failed​(java.lang.Throwable error,
                           java.lang.Void ignored)
        Specified by:
        failed in interface java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>