Package akka.io

Class TcpConnection

    • Constructor Detail

      • TcpConnection

        public TcpConnection​(TcpExt tcp,
                             java.nio.channels.SocketChannel channel,
                             boolean pullMode)
    • Method Detail

      • doNothing

        public static scala.Function0<scala.runtime.BoxedUnit> doNothing()
      • DroppingWriteBecauseWritingIsSuspendedException

        public static java.io.IOException DroppingWriteBecauseWritingIsSuspendedException()
      • DroppingWriteBecauseQueueIsFullException

        public static java.io.IOException DroppingWriteBecauseQueueIsFullException()
      • context

        public ActorContext context()
        Description copied from interface: Actor
        Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

        WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

        ActorContext is the Scala API. getContext returns a AbstractActor.ActorContext, which is the Java API of the actor context.

        Specified by:
        context in interface Actor
        Returns:
        (undocumented)
      • self

        public final ActorRef self()
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        self in interface Actor
        Returns:
        (undocumented)
      • akka$actor$Actor$_setter_$self_$eq

        protected final void akka$actor$Actor$_setter_$self_$eq​(ActorRef x$1)
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        akka$actor$Actor$_setter_$self_$eq in interface Actor
        Parameters:
        x$1 - (undocumented)
      • channel

        public java.nio.channels.SocketChannel channel()
      • pullMode

        public boolean pullMode()
      • signDeathPact

        protected void signDeathPact​(ActorRef actor)
      • unsignDeathPact

        protected void unsignDeathPact()
      • writePending

        public boolean writePending()
      • waitingForRegistration

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> waitingForRegistration​(ChannelRegistration registration,
                                                                                                            ActorRef commander)
        connection established, waiting for registration from user handler
      • connected

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> connected​(TcpConnection.ConnectionInfo info)
        normal connected state
      • peerSentEOF

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> peerSentEOF​(TcpConnection.ConnectionInfo info)
        the peer sent EOF first, but we may still want to send
      • closingWithPendingWrite

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> closingWithPendingWrite​(TcpConnection.ConnectionInfo info,
                                                                                                             scala.Option<ActorRef> closeCommander,
                                                                                                             Tcp.ConnectionClosed closedEvent)
        connection is closing but a write has to be finished first
      • closing

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> closing​(TcpConnection.ConnectionInfo info,
                                                                                             scala.Option<ActorRef> closeCommander)
        connection is closed on our side and we're waiting from confirmation from the other side
      • handleWriteMessages

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> handleWriteMessages​(TcpConnection.ConnectionInfo info)
      • unregistering

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> unregistering()
        stopWith sets this state while waiting for the SelectionHandler to execute the `cancelAndClose` thunk
      • completeConnect

        public void completeConnect​(ChannelRegistration registration,
                                    ActorRef commander,
                                    scala.collection.immutable.Traversable<Inet.SocketOption> options)
        used in subclasses to start the common machinery above once a channel is connected
      • doRead

        public void doRead​(TcpConnection.ConnectionInfo info,
                           scala.Option<ActorRef> closeCommander)
        Read from the channel and potentially send out Received message to handler.

        In some cases, this method will change the state with context.become.

        Parameters:
        info - (undocumented)
        closeCommander - (undocumented)
      • handleError

        public void handleError​(ActorRef handler,
                                java.io.IOException exception)
      • safeShutdownOutput

        public boolean safeShutdownOutput()
      • prepareAbort

        public void prepareAbort()
      • stopWith$default$2

        public boolean stopWith$default$2()
      • postStop

        public void postStop()
        Description copied from interface: Actor
        User overridable callback.

        Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
        Specified by:
        postStop in interface Actor
      • postRestart

        public void postRestart​(java.lang.Throwable reason)
        Description copied from interface: Actor
        User overridable callback: By default it calls preStart().
        Specified by:
        postRestart in interface Actor
        Parameters:
        reason - the Throwable that caused the restart to happen

        Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.