Package akka.io

Class Tcp


  • public class Tcp
    extends java.lang.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 Akka 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  Tcp.Abort$
      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  Tcp.Aborted$
      The connection has been aborted in response to an Abort command.
      static class  Tcp.Bind
      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  Tcp.Bind$  
      static class  Tcp.Bound
      The sender of a Tcp.Bind command will—in case of success—receive confirmation in this form.
      static class  Tcp.Bound$  
      static class  Tcp.Close$
      A normal close operation will first flush pending writes and then close the socket.
      static interface  Tcp.CloseCommand
      Common interface for all commands which aim to close down an open connection.
      static class  Tcp.Closed$
      The connection has been closed normally in response to a Close command.
      static interface  Tcp.Command
      This is the common trait for all commands understood by TCP actors.
      static class  Tcp.CommandFailed
      Whenever a command cannot be completed, the queried actor will reply with this message, wrapping the original command which failed.
      static class  Tcp.CommandFailed$  
      static class  Tcp.CompoundWrite
      A write command which aggregates two other write commands.
      static class  Tcp.CompoundWrite$  
      static class  Tcp.ConfirmedClose$
      A confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half.
      static class  Tcp.ConfirmedClosed$
      The connection has been half-closed by us and then half-close by the peer in response to a ConfirmedClose command.
      static class  Tcp.Connect
      The Connect message is sent to the TCP manager actor, which is obtained via TcpExt.manager().
      static class  Tcp.Connect$  
      static class  Tcp.Connected
      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  Tcp.Connected$  
      static interface  Tcp.ConnectionClosed
      This is the common interface for all events which indicate that a connection has been closed or half-closed.
      static class  Tcp.ErrorClosed
      The connection has been closed due to an IO error.
      static class  Tcp.ErrorClosed$  
      static interface  Tcp.Event
      Common interface for all events generated by the TCP layer actors.
      static interface  Tcp.Message
      The common interface for Tcp.Command and Tcp.Event.
      static class  Tcp.NoAck
      Each Tcp.WriteCommand can optionally request a positive acknowledgment to be sent to the commanding actor.
      static class  Tcp.NoAck$
      Default Tcp.NoAck instance which is used when no acknowledgment information is explicitly provided.
      static class  Tcp.PeerClosed$
      The peer has closed its writing half of the connection.
      static class  Tcp.Received
      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  Tcp.Received$  
      static class  Tcp.Register
      This message must be sent to a TCP connection actor after receiving the Tcp.Connected message.
      static class  Tcp.Register$  
      static class  Tcp.ResumeAccepting
      This message enables the accepting of the next connection if read throttling is enabled for connection actors.
      static class  Tcp.ResumeAccepting$  
      static class  Tcp.ResumeReading$
      This command needs to be sent to the connection actor after a SuspendReading command in order to resume reading from the socket.
      static class  Tcp.ResumeWriting$
      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  Tcp.SimpleWriteCommand
      Common supertype of Tcp.Write and Tcp.WriteFile.
      static class  Tcp.SO$
      Scala API: this object contains all applicable socket options for TCP.
      static class  Tcp.SuspendReading$
      Sending this command to the connection actor will disable reading from the TCP socket.
      static class  Tcp.Unbind$
      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  Tcp.Unbound
      The sender of an Unbind command will receive confirmation through this message once the listening socket has been closed.
      static class  Tcp.Unbound$  
      static class  Tcp.Write
      Write data to the TCP connection.
      static class  Tcp.Write$  
      static class  Tcp.WriteCommand
      Common interface for all write commands.
      static class  Tcp.WriteCommand$  
      static class  Tcp.WriteFile
      Deprecated.
      Use WritePath instead.
      static class  Tcp.WriteFile$
      Deprecated.
      .
      static class  Tcp.WritePath
      Write count bytes starting at position from file at filePath to the connection.
      static class  Tcp.WritePath$  
      static interface  Tcp.WritingResumed
      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  Tcp.WritingResumed$  
    • Constructor Summary

      Constructors 
      Constructor Description
      Tcp()