Package akka.io
Class Tcp
- java.lang.Object
-
- akka.io.Tcp
-
public class Tcp extends java.lang.ObjectTCP 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.Connectmessage to theTcpExt.manager().In order to start listening for inbound connections send a
Tcp.Bindmessage 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 classTcp.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 classTcp.Aborted$The connection has been aborted in response to anAbortcommand.static classTcp.BindThe Bind message is send to the TCP manager actor, which is obtained viaTcpExt.manager()in order to bind to a listening socket.static classTcp.Bind$static classTcp.BoundThe sender of aTcp.Bindcommand will—in case of success—receive confirmation in this form.static classTcp.Bound$static classTcp.Close$A normal close operation will first flush pending writes and then close the socket.static interfaceTcp.CloseCommandCommon interface for all commands which aim to close down an open connection.static classTcp.Closed$The connection has been closed normally in response to aClosecommand.static interfaceTcp.CommandThis is the common trait for all commands understood by TCP actors.static classTcp.CommandFailedWhenever a command cannot be completed, the queried actor will reply with this message, wrapping the original command which failed.static classTcp.CommandFailed$static classTcp.CompoundWriteA write command which aggregates two other write commands.static classTcp.CompoundWrite$static classTcp.ConfirmedClose$A confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half.static classTcp.ConfirmedClosed$The connection has been half-closed by us and then half-close by the peer in response to aConfirmedClosecommand.static classTcp.ConnectThe Connect message is sent to the TCP manager actor, which is obtained viaTcpExt.manager().static classTcp.Connect$static classTcp.ConnectedThe connection actor sends this message either to the sender of aTcp.Connectcommand (for outbound) or to the handler for incoming connections designated in theTcp.Bindmessage.static classTcp.Connected$static interfaceTcp.ConnectionClosedThis is the common interface for all events which indicate that a connection has been closed or half-closed.static classTcp.ErrorClosedThe connection has been closed due to an IO error.static classTcp.ErrorClosed$static interfaceTcp.EventCommon interface for all events generated by the TCP layer actors.static interfaceTcp.MessageThe common interface forTcp.CommandandTcp.Event.static classTcp.NoAckEachTcp.WriteCommandcan optionally request a positive acknowledgment to be sent to the commanding actor.static classTcp.NoAck$DefaultTcp.NoAckinstance which is used when no acknowledgment information is explicitly provided.static classTcp.PeerClosed$The peer has closed its writing half of the connection.static classTcp.ReceivedWhenever data are read from a socket they will be transferred within this class to the handler actor which was designated in theTcp.Registermessage.static classTcp.Received$static classTcp.RegisterThis message must be sent to a TCP connection actor after receiving theTcp.Connectedmessage.static classTcp.Register$static classTcp.ResumeAcceptingThis message enables the accepting of the next connection if read throttling is enabled for connection actors.static classTcp.ResumeAccepting$static classTcp.ResumeReading$This command needs to be sent to the connection actor after aSuspendReadingcommand in order to resume reading from the socket.static classTcp.ResumeWriting$WhenuseResumeWritingis in effect as was indicated in theTcp.Registermessage then this command needs to be sent to the connection actor in order to re-enable writing after aTcp.CommandFailedevent.static classTcp.SimpleWriteCommandCommon supertype ofTcp.WriteandTcp.WriteFile.static classTcp.SO$Scala API: this object contains all applicable socket options for TCP.static classTcp.SuspendReading$Sending this command to the connection actor will disable reading from the TCP socket.static classTcp.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.Boundmessage).static interfaceTcp.UnboundThe sender of anUnbindcommand will receive confirmation through this message once the listening socket has been closed.static classTcp.Unbound$static classTcp.WriteWrite data to the TCP connection.static classTcp.Write$static classTcp.WriteCommandCommon interface for all write commands.static classTcp.WriteCommand$static classTcp.WriteFileDeprecated.Use WritePath instead.static classTcp.WriteFile$static classTcp.WritePathWritecountbytes starting atpositionfrom file atfilePathto the connection.static classTcp.WritePath$static interfaceTcp.WritingResumedWhenuseResumeWritingis in effect as indicated in theTcp.Registermessage, theResumeWritingcommand will be acknowledged by this message type, upon which it is safe to send at least one write.static classTcp.WritingResumed$
-
Constructor Summary
Constructors Constructor Description Tcp()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tapply(ActorSystem system)static Tapply(ClassicActorSystemProvider system)static TcpExtcreateExtension(ExtendedActorSystem system)static booleanequals(java.lang.Object other)static TcpExtget(ActorSystem system)Java API: retrieve the Tcp extension for the given system.static TcpExtget(ClassicActorSystemProvider system)static inthashCode()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)
-
-