Class Tcp

java.lang.Object
org.apache.pekko.io.Tcp

public class Tcp extends Object
TCP Extension for Akka’s IO layer.

For a full description of the design and philosophy behind this IO implementation please refer to the Pekko online documentation.

In order to open an outbound connection send a Tcp.Connect message to the TcpExt.manager().

In order to start listening for inbound connections send a Tcp.Bind message to the TcpExt.manager().

The Java API for generating TCP commands is available at TcpMessage.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An abort operation will not flush pending writes and will issue a TCP ABORT command to the O/S kernel which should result in a TCP_RST packet being sent to the peer.
    static class 
    The connection has been aborted in response to an Abort command.
    static final class 
    The Bind message is send to the TCP manager actor, which is obtained via TcpExt.manager() in order to bind to a listening socket.
    static class 
     
    static final class 
    The sender of a Tcp.Bind command will—in case of success—receive confirmation in this form.
    static class 
     
    static class 
    A normal close operation will first flush pending writes and then close the socket.
    static interface 
    Common interface for all commands which aim to close down an open connection.
    static class 
    The connection has been closed normally in response to a Close command.
    static interface 
    This is the common trait for all commands understood by TCP actors.
    static final class 
    Whenever a command cannot be completed, the queried actor will reply with this message, wrapping the original command which failed.
    static class 
     
    static final class 
    A write command which aggregates two other write commands.
    static class 
     
    static class 
    A confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half.
    static class 
    The connection has been half-closed by us and then half-close by the peer in response to a ConfirmedClose command.
    static final class 
    The Connect message is sent to the TCP manager actor, which is obtained via TcpExt.manager().
    static class 
     
    static final class 
    The connection actor sends this message either to the sender of a Tcp.Connect command (for outbound) or to the handler for incoming connections designated in the Tcp.Bind message.
    static class 
     
    static interface 
    This is the common interface for all events which indicate that a connection has been closed or half-closed.
    static final class 
    The connection has been closed due to an IO error.
    static class 
     
    static interface 
    Common interface for all events generated by the TCP layer actors.
    static interface 
    The common interface for Tcp.Command and Tcp.Event.
    static class 
    Each Tcp.WriteCommand can optionally request a positive acknowledgment to be sent to the commanding actor.
    static class 
    Default Tcp.NoAck instance which is used when no acknowledgment information is explicitly provided.
    static class 
    The peer has closed its writing half of the connection.
    static final class 
    Whenever data are read from a socket they will be transferred within this class to the handler actor which was designated in the Tcp.Register message.
    static class 
     
    static final class 
    This message must be sent to a TCP connection actor after receiving the Tcp.Connected message.
    static class 
     
    static final class 
    This message enables the accepting of the next connection if read throttling is enabled for connection actors.
    static class 
     
    static class 
    This command needs to be sent to the connection actor after a SuspendReading command in order to resume reading from the socket.
    static class 
    When useResumeWriting is in effect as was indicated in the Tcp.Register message then this command needs to be sent to the connection actor in order to re-enable writing after a Tcp.CommandFailed event.
    static class 
    Common supertype of Tcp.Write and WriteFile.
    static class 
    Scala API: this object contains all applicable socket options for TCP.
    static class 
    Sending this command to the connection actor will disable reading from the TCP socket.
    static class 
    In order to close down a listening socket, send this message to that socket’s actor (that is the actor which previously had sent the Tcp.Bound message).
    static interface 
    The sender of an Unbind command will receive confirmation through this message once the listening socket has been closed.
    static class 
     
    static final class 
    Write data to the TCP connection.
    static class 
     
    static class 
    Common interface for all write commands.
    static class 
     
    static final class 
    Write count bytes starting at position from file at filePath to the connection.
    static class 
     
    static interface 
    When useResumeWriting is in effect as indicated in the Tcp.Register message, the ResumeWriting command will be acknowledged by this message type, upon which it is safe to send at least one write.
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tcp()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static T
     
    static T
     
    static TcpExt
     
    static final boolean
    equals(Object other)
     
    static TcpExt
    get(ActorSystem system)
    Java API: retrieve the Tcp extension for the given system.
    static TcpExt
     
    static final int
     
    static Tcp$
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait