Package akka.io
Class UdpConnectedMessage$
- java.lang.Object
-
- akka.io.UdpConnectedMessage$
-
public class UdpConnectedMessage$ extends java.lang.Object
Java API: factory methods for the message types used when communicating with the UdpConnected service.
-
-
Field Summary
Fields Modifier and Type Field Description static UdpConnectedMessage$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description UdpConnectedMessage$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UdpConnected.Command
connect(ActorRef handler, java.net.InetSocketAddress remoteAddress)
Connect without specifying thelocalAddress
oroptions
.UdpConnected.Command
connect(ActorRef handler, java.net.InetSocketAddress remoteAddress, java.lang.Iterable<Inet.SocketOption> options)
Connect without specifying thelocalAddress
.UdpConnected.Command
connect(ActorRef handler, java.net.InetSocketAddress remoteAddress, java.net.InetSocketAddress localAddress, java.lang.Iterable<Inet.SocketOption> options)
Send this message to theUdpExt.manager()
in order to bind to a local port (optionally with the chosenlocalAddress
) and create a UDP socket which is restricted to sending to and receiving from the givenremoteAddress
.UdpConnected.Command
disconnect()
Send this message to a connection actor (which had previously sent theUdpConnected.Connected
message) in order to close the socket.UdpConnected.NoAck
noAck()
DefaultUdpConnected.NoAck
instance which is used when no acknowledgment information is explicitly provided.UdpConnected.NoAck
noAck(java.lang.Object token)
EachUdpConnected.Send
can optionally request a positive acknowledgment to be sent to the commanding actor.UdpConnected.Command
resumeReading()
This message must be sent to the listener actor to re-enable reading from the socket after aUdpConnected.SuspendReading
command.UdpConnected.Command
send(ByteString data)
Send without requesting acknowledgment.UdpConnected.Command
send(ByteString data, java.lang.Object ack)
This message is understood by the connection actors to send data to their designated destination.UdpConnected.Command
suspendReading()
Send this message to a listener actor (which sent aUdp.Bound
message) to have it stop reading datagrams from the network.
-
-
-
Field Detail
-
MODULE$
public static final UdpConnectedMessage$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
connect
public UdpConnected.Command connect(ActorRef handler, java.net.InetSocketAddress remoteAddress, java.net.InetSocketAddress localAddress, java.lang.Iterable<Inet.SocketOption> options)
Send this message to theUdpExt.manager()
in order to bind to a local port (optionally with the chosenlocalAddress
) and create a UDP socket which is restricted to sending to and receiving from the givenremoteAddress
. All received datagrams will be sent to the designatedhandler
actor.
-
connect
public UdpConnected.Command connect(ActorRef handler, java.net.InetSocketAddress remoteAddress, java.lang.Iterable<Inet.SocketOption> options)
Connect without specifying thelocalAddress
.
-
connect
public UdpConnected.Command connect(ActorRef handler, java.net.InetSocketAddress remoteAddress)
Connect without specifying thelocalAddress
oroptions
.
-
send
public 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 withUdpConnected.CommandFailed
if the send could not be enqueued to the O/S kernel because the send buffer was full. If the givenack
is not of typeUdpConnected.NoAck
the connection actor will reply with the given object as soon as the datagram has been successfully enqueued to the O/S kernel.
-
send
public UdpConnected.Command send(ByteString data)
Send without requesting acknowledgment.
-
disconnect
public UdpConnected.Command disconnect()
Send this message to a connection actor (which had previously sent theUdpConnected.Connected
message) in order to close the socket. The connection actor will reply with aUdpConnected.Disconnected
message.
-
noAck
public UdpConnected.NoAck noAck(java.lang.Object token)
EachUdpConnected.Send
can optionally request a positive acknowledgment to be sent to the commanding actor. If such notification is not desired theUdpConnected.Send.ack()
must be set to an instance of this class. The token contained within can be used to recognize which write failed when receiving aUdpConnected.CommandFailed
message.
-
noAck
public UdpConnected.NoAck noAck()
DefaultUdpConnected.NoAck
instance which is used when no acknowledgment information is explicitly provided. Its “token” isnull
.
-
suspendReading
public UdpConnected.Command suspendReading()
Send this message to a listener actor (which sent aUdp.Bound
message) to have it stop reading datagrams from the network. If the O/S kernel’s receive buffer runs full then subsequent datagrams will be silently discarded. Re-enable reading from the socket using theUdpConnected.ResumeReading
command.
-
resumeReading
public UdpConnected.Command resumeReading()
This message must be sent to the listener actor to re-enable reading from the socket after aUdpConnected.SuspendReading
command.
-
-