Package org.apache.pekko.io
Class Tcp
java.lang.Object
org.apache.pekko.io.Tcp
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 ClassesModifier and TypeClassDescriptionstatic classAn 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 classThe connection has been aborted in response to anAbortcommand.static final classThe Bind message is send to the TCP manager actor, which is obtained viaTcpExt.manager()in order to bind to a listening socket.static classstatic final classThe sender of aTcp.Bindcommand will—in case of success—receive confirmation in this form.static classstatic classA normal close operation will first flush pending writes and then close the socket.static interfaceCommon interface for all commands which aim to close down an open connection.static classThe connection has been closed normally in response to aClosecommand.static interfaceThis is the common trait for all commands understood by TCP actors.static final classWhenever a command cannot be completed, the queried actor will reply with this message, wrapping the original command which failed.static classstatic final classA write command which aggregates two other write commands.static classstatic classA confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half.static classThe connection has been half-closed by us and then half-close by the peer in response to aConfirmedClosecommand.static final classThe Connect message is sent to the TCP manager actor, which is obtained viaTcpExt.manager().static classstatic final classThe 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 classstatic interfaceThis is the common interface for all events which indicate that a connection has been closed or half-closed.static final classThe connection has been closed due to an IO error.static classstatic interfaceCommon interface for all events generated by the TCP layer actors.static interfaceThe common interface forTcp.CommandandTcp.Event.static classEachTcp.WriteCommandcan optionally request a positive acknowledgment to be sent to the commanding actor.static classDefaultTcp.NoAckinstance which is used when no acknowledgment information is explicitly provided.static classThe peer has closed its writing half of the connection.static final classWhenever data are read from a socket they will be transferred within this class to the handler actor which was designated in theTcp.Registermessage.static classstatic final classThis message must be sent to a TCP connection actor after receiving theTcp.Connectedmessage.static classstatic final classThis message enables the accepting of the next connection if read throttling is enabled for connection actors.static classstatic classThis command needs to be sent to the connection actor after aSuspendReadingcommand in order to resume reading from the socket.static classWhenuseResumeWritingis 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 classCommon supertype ofTcp.WriteandWriteFile.static classScala API: this object contains all applicable socket options for TCP.static classSending this command to the connection actor will disable reading from the TCP socket.static classIn 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 interfaceThe sender of anUnbindcommand will receive confirmation through this message once the listening socket has been closed.static classstatic final classWrite data to the TCP connection.static classstatic classCommon interface for all write commands.static classstatic final classWritecountbytes starting atpositionfrom file atfilePathto the connection.static classstatic interfaceWhenuseResumeWritingis 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 class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Tapply(ActorSystem system) static Tapply(ClassicActorSystemProvider system) static TcpExtcreateExtension(ExtendedActorSystem system) static final booleanstatic TcpExtget(ActorSystem system) Java API: retrieve the Tcp extension for the given system.static TcpExtget(ClassicActorSystemProvider system) static final inthashCode()static Tcp$lookup()
-
Constructor Details
-
Tcp
public Tcp()
-
-
Method Details
-
lookup
-
createExtension
-
get
Java API: retrieve the Tcp extension for the given system. -
get
-
apply
-
apply
-
hashCode
public static final int hashCode() -
equals
-