o

akka.io

TcpMessage

object TcpMessage

Source
Tcp.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TcpMessage
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def abort: Command

    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.

    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. The sender of this command and the registered handler for incoming data will both be notified once the socket is closed using a Tcp.Aborted message.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def bind(handler: ActorRef, endpoint: InetSocketAddress, backlog: Int): Command

    Open a listening socket without specifying options.

  7. def bind(handler: ActorRef, endpoint: InetSocketAddress, backlog: Int, options: Iterable[SocketOption], pullMode: Boolean): Command

    The Bind message is send to the TCP manager actor, which is obtained via TcpExt#getManager in order to bind to a listening socket.

    The Bind message is send to the TCP manager actor, which is obtained via TcpExt#getManager in order to bind to a listening socket. The manager replies either with a Tcp.CommandFailed or the actor handling the listen socket replies with a Tcp.Bound message. If the local port is set to 0 in the Bind message, then the Tcp.Bound message should be inspected to find the actual port which was bound to.

    handler

    The actor which will receive all incoming connection requests in the form of Tcp.Connected messages.

    endpoint

    The socket address to bind to; use port zero for automatic assignment (i.e. an ephemeral port, see Tcp.Bound)

    backlog

    This specifies the number of unaccepted connections the O/S kernel will hold for this port before refusing connections.

    options

    Please refer to TcpSO for a list of all supported options.

    pullMode

    enables pull based accepting and of connections and pull based reading from the accepted connections.

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  9. def close: Command

    A normal close operation will first flush pending writes and then close the socket.

    A normal close operation will first flush pending writes and then close the socket. The sender of this command and the registered handler for incoming data will both be notified once the socket is closed using a Tcp.Closed message.

  10. def confirmedClose: Command

    A confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half.

    A confirmed close operation will flush pending writes and half-close the connection, waiting for the peer to close the other half. The sender of this command and the registered handler for incoming data will both be notified once the socket is closed using a Tcp.ConfirmedClosed message.

  11. def connect(remoteAddress: InetSocketAddress): Command

    Connect to the given remoteAddress without binding to a local address and without specifying options.

  12. def connect(remoteAddress: InetSocketAddress, localAddress: InetSocketAddress, options: Iterable[SocketOption], timeout: Duration, pullMode: Boolean): Command

    The Connect message is sent to the TCP manager actor, which is obtained via TcpExt#getManager.

    The Connect message is sent to the TCP manager actor, which is obtained via TcpExt#getManager. Either the manager replies with a Tcp.CommandFailed or the actor handling the new connection replies with a Tcp.Connected message.

    remoteAddress

    is the address to connect to

    localAddress

    optionally specifies a specific address to bind to

    options

    Please refer to TcpSO for a list of all supported options.

    timeout

    is the desired connection timeout, null means "no timeout"

    pullMode

    enables pull based reading from the connection

  13. def connect(remoteAddress: InetSocketAddress, localAddress: InetSocketAddress, options: Iterable[SocketOption], timeout: FiniteDuration, pullMode: Boolean): Command

    The Connect message is sent to the TCP manager actor, which is obtained via TcpExt#getManager.

    The Connect message is sent to the TCP manager actor, which is obtained via TcpExt#getManager. Either the manager replies with a Tcp.CommandFailed or the actor handling the new connection replies with a Tcp.Connected message.

    remoteAddress

    is the address to connect to

    localAddress

    optionally specifies a specific address to bind to

    options

    Please refer to TcpSO for a list of all supported options.

    timeout

    is the desired connection timeout, null means "no timeout"

    pullMode

    enables pull based reading from the connection

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def noAck: NoAck

    Default Tcp.NoAck instance which is used when no acknowledgment information is explicitly provided.

    Default Tcp.NoAck instance which is used when no acknowledgment information is explicitly provided. Its “token” is null.

  21. def noAck(token: AnyRef): NoAck

    Each Tcp.WriteCommand can optionally request a positive acknowledgment to be sent to the commanding actor.

    Each Tcp.WriteCommand can optionally request a positive acknowledgment to be sent to the commanding actor. If such notification is not desired the Tcp.SimpleWriteCommand#ack must be set to an instance of this class. The token contained within can be used to recognize which write failed when receiving a Tcp.CommandFailed message.

  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def register(handler: ActorRef): Command

    The same as register(handler, false, false).

  25. def register(handler: ActorRef, keepOpenOnPeerClosed: Boolean, useResumeWriting: Boolean): Command

    This message must be sent to a TCP connection actor after receiving the Tcp.Connected message.

    This message must be sent to a TCP connection actor after receiving the Tcp.Connected message. The connection will not read any data from the socket until this message is received, because this message defines the actor which will receive all inbound data.

    handler

    The actor which will receive all incoming data and which will be informed when the connection is closed.

    keepOpenOnPeerClosed

    If this is set to true then the connection is not automatically closed when the peer closes its half, requiring an explicit Tcp.ConnectionClosed from our side when finished.

    useResumeWriting

    If this is set to true then the connection actor will refuse all further writes after issuing a Tcp.CommandFailed notification until Tcp ResumeWriting is received. This can be used to implement NACK-based write backpressure.

  26. def resumeAccepting(batchSize: Int): Command

    This message enables the accepting of the next connection if pull reading is enabled for connection actors.

    This message enables the accepting of the next connection if pull reading is enabled for connection actors.

    batchSize

    The number of connections to accept before waiting for the next resume command

  27. def resumeReading: Command

    This command needs to be sent to the connection actor after a Tcp.SuspendReading command in order to resume reading from the socket.

  28. def resumeWriting: Command

    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.

    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. All Tcp.WriteCommand processed by the connection actor between the first Tcp.CommandFailed and subsequent reception of this message will also be rejected with Tcp.CommandFailed.

  29. def suspendReading: Command

    Sending this command to the connection actor will disable reading from the TCP socket.

    Sending this command to the connection actor will disable reading from the TCP socket. TCP flow-control will then propagate backpressure to the sender side as buffers fill up on either end. To re-enable reading send Tcp.ResumeReading.

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. def unbind: Command

    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).

    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). The listener socket actor will reply with a Tcp.Unbound message.

  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. def write(data: ByteString): Command

    The same as write(data, noAck()).

  37. def write(data: ByteString, ack: Event): Command

    Write data to the TCP connection.

    Write data to the TCP connection. If no ack is needed use the special NoAck object. The connection actor will reply with a Tcp.CommandFailed message if the write could not be enqueued. If Tcp.SimpleWriteCommand#wantsAck returns true, the connection actor will reply with the supplied Tcp.SimpleWriteCommand#ack token once the write has been successfully enqueued to the O/S kernel. Note that this does not in any way guarantee that the data will be or have been sent! Unfortunately there is no way to determine whether a particular write has been sent by the O/S.

  38. def writeFile(filePath: String, position: Long, count: Long, ack: Event): Command

    Write count bytes starting at position from file at filePath to the connection.

    Write count bytes starting at position from file at filePath to the connection. The count must be > 0. The connection actor will reply with a Tcp.CommandFailed message if the write could not be enqueued. If Tcp.SimpleWriteCommand#wantsAck returns true, the connection actor will reply with the supplied Tcp.SimpleWriteCommand#ack token once the write has been successfully enqueued to the O/S kernel. Note that this does not in any way guarantee that the data will be or have been sent! Unfortunately there is no way to determine whether a particular write has been sent by the O/S.

  39. def writePath(filePath: Path, position: Long, count: Long, ack: Event): Command

    Write count bytes starting at position from file at filePath to the connection.

    Write count bytes starting at position from file at filePath to the connection. The count must be > 0. The connection actor will reply with a Tcp.CommandFailed message if the write could not be enqueued. If Tcp.SimpleWriteCommand#wantsAck returns true, the connection actor will reply with the supplied Tcp.SimpleWriteCommand#ack token once the write has been successfully enqueued to the O/S kernel. Note that this does not in any way guarantee that the data will be or have been sent! Unfortunately there is no way to determine whether a particular write has been sent by the O/S.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped