Package akka.io
Class Tcp
- java.lang.Object
-
- akka.io.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 theTcpExt.manager()
.In order to start listening for inbound connections send a
Tcp.Bind
message to theTcpExt.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 anAbort
command.static class
Tcp.Bind
The Bind message is send to the TCP manager actor, which is obtained viaTcpExt.manager()
in order to bind to a listening socket.static class
Tcp.Bind$
static class
Tcp.Bound
The sender of aTcp.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 aClose
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 aConfirmedClose
command.static class
Tcp.Connect
The Connect message is sent to the TCP manager actor, which is obtained viaTcpExt.manager()
.static class
Tcp.Connect$
static class
Tcp.Connected
The connection actor sends this message either to the sender of aTcp.Connect
command (for outbound) or to the handler for incoming connections designated in theTcp.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 forTcp.Command
andTcp.Event
.static class
Tcp.NoAck
EachTcp.WriteCommand
can optionally request a positive acknowledgment to be sent to the commanding actor.static class
Tcp.NoAck$
DefaultTcp.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 theTcp.Register
message.static class
Tcp.Received$
static class
Tcp.Register
This message must be sent to a TCP connection actor after receiving theTcp.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 aSuspendReading
command in order to resume reading from the socket.static class
Tcp.ResumeWriting$
WhenuseResumeWriting
is in effect as was indicated in theTcp.Register
message then this command needs to be sent to the connection actor in order to re-enable writing after aTcp.CommandFailed
event.static class
Tcp.SimpleWriteCommand
Common supertype ofTcp.Write
andTcp.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 theTcp.Bound
message).static interface
Tcp.Unbound
The sender of anUnbind
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$
static class
Tcp.WritePath
Writecount
bytes starting atposition
from file atfilePath
to the connection.static class
Tcp.WritePath$
static interface
Tcp.WritingResumed
WhenuseResumeWriting
is in effect as indicated in theTcp.Register
message, theResumeWriting
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()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static T
apply(ActorSystem system)
static T
apply(ClassicActorSystemProvider system)
static TcpExt
createExtension(ExtendedActorSystem system)
static boolean
equals(java.lang.Object other)
static TcpExt
get(ActorSystem system)
Java API: retrieve the Tcp extension for the given system.static TcpExt
get(ClassicActorSystemProvider system)
static int
hashCode()
static Tcp$
lookup()
-
-
-
Method Detail
-
lookup
public static Tcp$ lookup()
-
createExtension
public static TcpExt createExtension(ExtendedActorSystem system)
-
get
public static TcpExt get(ActorSystem system)
Java API: retrieve the Tcp extension for the given system.
-
get
public static TcpExt get(ClassicActorSystemProvider system)
-
apply
public static T apply(ActorSystem system)
-
apply
public static T apply(ClassicActorSystemProvider system)
-
hashCode
public static final int hashCode()
-
equals
public static final boolean equals(java.lang.Object other)
-
-