DatagramPacket's to remote datagram servers
and receive DatagramPackets .
Usually you use a datagram socket to send UDP over the wire. UDP is connection-less which means you are not connected to the remote peer in a persistent way. Because of this you have to supply the address and port of the remote peer when sending data.
You can send data to ipv4 or ipv6 addresses, which also include multicast addresses.
Please consult the documentation for more information on datagram sockets.
| Modifier and Type | Method and Description |
|---|---|
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address for which you want to block the source address multicastAddress, String the source address which should be blocked. You will not receive an multicast packets
for it anymore. sourceToBlock, Handler<AsyncResult<Void>> the handler to notify once the operation completes handler)Block the given address for the given multicast address and notifies the |
| public Future | blockMulticastGroup(String multicastAddress, String sourceToBlock)
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address for which you want to block the source address multicastAddress, String the network interface on which the blocking should occur. networkInterface, String the source address which should be blocked. You will not receive an multicast packets
for it anymore. sourceToBlock, Handler<AsyncResult<Void>> the handler to notify once the operation completes handler)Block the given address for the given multicast address on the given network interface and notifies
the |
| public Future | blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock)
Like |
| public void | close(Handler<AsyncResult<Void>>
the handler to notify once complete handler)Closes the |
| public Future | |
| public DatagramSocket | |
| public DatagramSocket | |
| public DatagramSocket | fetch(long amount)
Redeclares io.
Deprecated
no replacement for back-pressure, instead ignore the packet or buffer it somewhere
Fetch the specified |
| public DatagramSocket | |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe port to listen on port, String the host to listen on host, Handler<AsyncResult<DatagramSocket>> the handler will be called when listening handler)Start listening on the given port and host. |
| public Future | listen(int port, String host)
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address of the multicast group to join multicastAddress, Handler<AsyncResult<Void>> then handler to notify once the operation completes handler)Joins a multicast group and listens for packets send to it. |
| public Future | listenMulticastGroup(String multicastAddress)
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address of the multicast group to join multicastAddress, String the network interface on which to listen for packets. networkInterface, @Nullable String the address of the source for which we will listen for multicast packets source, Handler<AsyncResult<Void>> then handler to notify once the operation completes handler)Joins a multicast group and listens for packets send to it on the given network interface. |
| public Future | listenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source)
Like |
| public SocketAddress | Returns: the socket addressReturn the |
| public DatagramSocket | pause()
Redeclares io.
Deprecated
no replacement for back-pressure, instead ignore the packet or buffer it somewhere
Pause the |
| public DatagramSocket | resume()
Redeclares io.
Deprecated
no replacement for back-pressure, instead ignore the packet or buffer it somewhere
Resume reading, and sets the buffer in |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe packet, int io. to writethe host port of the remote peer port, String the host address of the remote peer host, Handler<AsyncResult<Void>> the handler)io. to notify once the write completes.
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Write the given |
| public Future | send(Buffer packet, int port, String host)
References Deprecated
Buffer is deprecated or references (maybe indirectly) at least one deprecated element.
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe str, int String to writethe host port of the remote peer port, String the host address of the remote peer host, Handler<AsyncResult<Void>> the handler)io. to notify once the write completes.Write the given |
| public Future | send(String str, int port, String host)
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe str, String String to writethe charset used for encoding enc, int the host port of the remote peer port, String the host address of the remote peer host, Handler<AsyncResult<Void>> the handler)io. to notify once the write completes.Write the given |
| public Future | send(String str, String enc, int port, String host)
Like |
| public WriteStream | Returns: the write stream for sending packetsthe port of the remote peer port, String the host address of the remote peer host)Returns a |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address of the multicast group to leave multicastAddress, Handler<AsyncResult<Void>> then handler to notify once the operation completes handler)Leaves a multicast group and stops listening for packets send to it. |
| public Future | unlistenMulticastGroup(String multicastAddress)
Like |
| public DatagramSocket | Returns: a reference to this, so the API can be used fluentlythe address of the multicast group to join multicastAddress, String the network interface on which to listen for packets. networkInterface, @Nullable String the address of the source for which we will listen for multicast packets source, Handler<AsyncResult<Void>> the handler to notify once the operation completes handler)Leaves a multicast group and stops listening for packets send to it on the given network interface. |
| public Future | unlistenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source)
Like |
| blockMulticastGroup | back to summary |
|---|---|
| public DatagramSocket blockMulticastGroup(String multicastAddress, String sourceToBlock, Handler<AsyncResult<Void>> handler) Block the given address for the given multicast address and notifies the
| |
| blockMulticastGroup | back to summary |
|---|---|
| public Future Like | |
| blockMulticastGroup | back to summary |
|---|---|
| public DatagramSocket blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock, Handler<AsyncResult<Void>> handler) Block the given address for the given multicast address on the given network interface and notifies
the
| |
| blockMulticastGroup | back to summary |
|---|---|
| public Future Like | |
| close | back to summary |
|---|---|
| public void close(Handler<AsyncResult<Void>> handler) Closes the
| |
| close | back to summary |
|---|---|
| public Future Closes the | |
| endHandler | back to summary |
|---|---|
| public DatagramSocket endHandler(Handler<Void> endHandler)
Deprecated removed in Vert.x 5
| |
| exceptionHandler | back to summary |
|---|---|
public DatagramSocket exceptionHandler(Handler<Throwable> handler)
| |
| fetch | back to summary |
|---|---|
| public DatagramSocket fetch(long amount) Redeclares io. Doc from io. Deprecated no replacement for back-pressure, instead ignore the packet or buffer it somewhere Fetch the specified
| |
| handler | back to summary |
|---|---|
public DatagramSocket handler(Handler<DatagramPacket> handler)
| |
| listen | back to summary |
|---|---|
| public DatagramSocket listen(int port, String host, Handler<AsyncResult<DatagramSocket>> handler) Start listening on the given port and host. The handler will be called when the socket is listening.
| |
| listen | back to summary |
|---|---|
| public Future Like | |
| listenMulticastGroup | back to summary |
|---|---|
| public DatagramSocket listenMulticastGroup(String multicastAddress, Handler<AsyncResult<Void>> handler) Joins a multicast group and listens for packets send to it.
The
| |
| listenMulticastGroup | back to summary |
|---|---|
| public Future Like | |
| listenMulticastGroup | back to summary |
|---|---|
| public DatagramSocket listenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source, Handler<AsyncResult<Void>> handler) Joins a multicast group and listens for packets send to it on the given network interface.
The
| |
| listenMulticastGroup | back to summary |
|---|---|
| public Future Like | |
| localAddress | back to summary |
|---|---|
| public SocketAddress localAddress() Return the
| |
| pause | back to summary |
|---|---|
| public DatagramSocket pause() Redeclares io. Doc from io. Deprecated no replacement for back-pressure, instead ignore the packet or buffer it somewhere Pause the
While it's paused, no data will be sent to the data
| |
| resume | back to summary |
|---|---|
| public DatagramSocket resume() Redeclares io. Doc from io. Deprecated no replacement for back-pressure, instead ignore the packet or buffer it somewhere Resume reading, and sets the buffer in
If the
| |
| send | back to summary |
|---|---|
| public DatagramSocket send(Buffer packet, int port, String host, Handler<AsyncResult<Void>> handler)
References Deprecated
See corresponding docs for further information. Write the given
| |
| send | back to summary |
|---|---|
| public Future References Deprecated
See corresponding docs for further information. Like | |
| send | back to summary |
|---|---|
| public DatagramSocket send(String str, int port, String host, Handler<AsyncResult<Void>> handler) Write the given
| |
| send | back to summary |
|---|---|
| public Future Like | |
| send | back to summary |
|---|---|
| public DatagramSocket send(String str, String enc, int port, String host, Handler<AsyncResult<Void>> handler) Write the given
| |
| send | back to summary |
|---|---|
| public Future Like | |
| sender | back to summary |
|---|---|
| public WriteStream Returns a
| |
| unlistenMulticastGroup | back to summary |
|---|---|
| public DatagramSocket unlistenMulticastGroup(String multicastAddress, Handler<AsyncResult<Void>> handler) Leaves a multicast group and stops listening for packets send to it.
The
| |
| unlistenMulticastGroup | back to summary |
|---|---|
| public Future Like | |
| unlistenMulticastGroup | back to summary |
|---|---|
| public DatagramSocket unlistenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source, Handler<AsyncResult<Void>> handler) Leaves a multicast group and stops listening for packets send to it on the given network interface.
The
| |
| unlistenMulticastGroup | back to summary |
|---|---|
| public Future Like | |