Class UdpConnectedMessage


  • public class UdpConnectedMessage
    extends java.lang.Object
    Java API: factory methods for the message types used when communicating with the UdpConnected service.
    • Constructor Detail

      • UdpConnectedMessage

        public UdpConnectedMessage()
    • Method Detail

      • connect

        public static UdpConnected.Command connect​(ActorRef handler,
                                                   java.net.InetSocketAddress remoteAddress,
                                                   java.net.InetSocketAddress localAddress,
                                                   java.lang.Iterable<Inet.SocketOption> options)
        Send this message to the UdpExt.manager() in order to bind to a local port (optionally with the chosen localAddress) and create a UDP socket which is restricted to sending to and receiving from the given remoteAddress. All received datagrams will be sent to the designated handler actor.
      • connect

        public static UdpConnected.Command connect​(ActorRef handler,
                                                   java.net.InetSocketAddress remoteAddress)
        Connect without specifying the localAddress or options.
      • send

        public static UdpConnected.Command send​(ByteString data,
                                                java.lang.Object ack)
        This message is understood by the connection actors to send data to their designated destination. The connection actor will respond with UdpConnected.CommandFailed if the send could not be enqueued to the O/S kernel because the send buffer was full. If the given ack is not of type UdpConnected.NoAck the connection actor will reply with the given object as soon as the datagram has been successfully enqueued to the O/S kernel.
      • noAck

        public static UdpConnected.NoAck noAck()
        Default UdpConnected.NoAck instance which is used when no acknowledgment information is explicitly provided. Its &ldquo;token&rdquo; is null.
      • suspendReading

        public static UdpConnected.Command suspendReading()
        Send this message to a listener actor (which sent a Udp.Bound message) to have it stop reading datagrams from the network. If the O/S kernel&rsquo;s receive buffer runs full then subsequent datagrams will be silently discarded. Re-enable reading from the socket using the UdpConnected.ResumeReading command.
      • resumeReading

        public static UdpConnected.Command resumeReading()
        This message must be sent to the listener actor to re-enable reading from the socket after a UdpConnected.SuspendReading command.