Top Inners Fields Constructors Methods
io.vertx.core.datagram.impl

public Class DatagramSocketImpl

extends Object
implements DatagramSocket, MetricsProvider, Closeable
Class Inheritance
All Implemented Interfaces
io.vertx.core.Closeable, io.vertx.core.spi.metrics.MetricsProvider, io.vertx.core.metrics.Measured, io.vertx.core.datagram.DatagramSocket, io.vertx.core.streams.ReadStream, io.vertx.core.streams.StreamBase
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelFuture, .ChannelHandlerContext, .ChannelOption, .MaxMessagesRecvByteBufAllocator, io.netty.channel.socket.DatagramChannel, .DatagramPacket, .InternetProtocolFamily, io.netty.handler.logging.LoggingHandler, io.netty.util.concurrent.GenericFutureListener, io.vertx.codegen.annotations.Nullable, io.vertx.core.AsyncResult, .Closeable, .Future, .Handler, .Promise, io.vertx.core.buffer.Buffer, io.vertx.core.datagram.DatagramSocket, .DatagramSocketOptions, io.vertx.core.impl.AddressResolver, .Arguments, .CloseFuture, .ContextInternal, .VertxInternal, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.net.SocketAddress, io.vertx.core.net.impl.ConnectionBase, .VertxHandler, io.vertx.core.spi.transport.Transport, io.vertx.core.spi.metrics.*, io.vertx.core.streams.WriteStream, java.net.InetAddress, .InetSocketAddress, .NetworkInterface, .UnknownHostException, java.util.Objects

Author
Norman Maurer

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private DatagramChannel
private final CloseFuture
private final ContextInternal
private long
private Handler<Void>
private Handler<Throwable>
private final DatagramSocketMetrics
private Handler<DatagramPacket>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public DatagramSocket
blockMulticastGroup(String
the 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
)

Implements io.vertx.core.datagram.DatagramSocket.blockMulticastGroup.

Block the given address for the given multicast address on the given network interface and notifies the Handler once the operation completes.

public Future<Void>
blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock)

Implements io.vertx.core.datagram.DatagramSocket.blockMulticastGroup.

Like blockMulticastGroup(String, String, String, Handler) but returns a Future of the asynchronous result

public DatagramSocket
blockMulticastGroup(String
the 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
)

Implements io.vertx.core.datagram.DatagramSocket.blockMulticastGroup.

Block the given address for the given multicast address and notifies the Handler once the operation completes.

public Future<Void>
blockMulticastGroup(String multicastAddress, String sourceToBlock)

Implements io.vertx.core.datagram.DatagramSocket.blockMulticastGroup.

Like blockMulticastGroup(String, String, Handler) but returns a Future of the asynchronous result

public void
close(Handler<AsyncResult<Void>>
the handler to notify once complete
handler
)

Implements io.vertx.core.datagram.DatagramSocket.close.

Closes the io.vertx.core.datagram.DatagramSocket implementation asynchronous and notifies the handler once done.

public synchronized Future<Void>
public void
close(Promise<Void>
the promise to signal when close has completed
completion
)

Implements io.vertx.core.Closeable.close.

Close this resource, the completion promise must be notified when the operation has completed.

public static DatagramSocketImpl
private DatagramSocketImpl.Connection
private NetworkInterface
public DatagramSocketImpl
public DatagramSocketImpl
public synchronized DatagramSocket
fetch(long amount)

Implements io.vertx.core.datagram.DatagramSocket.fetch.

Fetch the specified amount of elements.

protected void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

public Metrics
getMetrics()

Implements io.vertx.core.spi.metrics.MetricsProvider.getMetrics.

Returns the metrics implementation.

public synchronized DatagramSocket
private void
init()

public boolean
isMetricsEnabled()

Overrides default io.vertx.core.metrics.Measured.isMetricsEnabled.

Whether the metrics are enabled for this measured object

public DatagramSocket
listen(int
the port to listen on
port
,
String
the host to listen on
address
,
Handler<AsyncResult<DatagramSocket>>
the handler will be called when listening
handler
)

Implements io.vertx.core.datagram.DatagramSocket.listen.

Start listening on the given port and host.

public Future<DatagramSocket>
listen(int port, String address)

Implements io.vertx.core.datagram.DatagramSocket.listen.

Like listen(int, String, Handler) but returns a Future of the asynchronous result

private Future<DatagramSocket>
public DatagramSocket
listenMulticastGroup(String
the address of the multicast group to join
multicastAddress
,
Handler<AsyncResult<Void>>
then handler to notify once the operation completes
handler
)

Implements io.vertx.core.datagram.DatagramSocket.listenMulticastGroup.

Joins a multicast group and listens for packets send to it.

public Future<Void>
listenMulticastGroup(String multicastAddress)

Implements io.vertx.core.datagram.DatagramSocket.listenMulticastGroup.

Like listenMulticastGroup(String, Handler) but returns a Future of the asynchronous result

public DatagramSocket
listenMulticastGroup(String multicastAddress, String networkInterface, String source, Handler<AsyncResult<Void>> handler)

public Future<Void>
listenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source)

public SocketAddress
public synchronized DatagramSocket
pause()

Implements io.vertx.core.datagram.DatagramSocket.pause.

Pause the ReadStream, it sets the buffer in fetch mode and clears the actual demand.

public synchronized DatagramSocket
resume()

Implements io.vertx.core.datagram.DatagramSocket.resume.

Resume reading, and sets the buffer in flowing mode.

public DatagramSocket
send(Buffer packet, int
the host port of the remote peer
port
,
String
the host address of the remote peer
host
,
Handler<AsyncResult<Void>>
the io.vertx.core.Handler to notify once the write completes.
handler
)

Implements io.vertx.core.datagram.DatagramSocket.send.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Write the given io.vertx.core.buffer.Buffer to the io.vertx.core.net.SocketAddress.

public Future<Void>
send(Buffer packet, int port, String host)

Implements io.vertx.core.datagram.DatagramSocket.send.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Like send(Buffer, int, String, Handler) but returns a Future of the asynchronous result

public DatagramSocket
send(String
the String to write
str
,
int
the host port of the remote peer
port
,
String
the host address of the remote peer
host
,
Handler<AsyncResult<Void>>
the io.vertx.core.Handler to notify once the write completes.
handler
)

Implements io.vertx.core.datagram.DatagramSocket.send.

Write the given String to the io.vertx.core.net.SocketAddress using UTF8 encoding.

public Future<Void>
send(String str, int port, String host)

Implements io.vertx.core.datagram.DatagramSocket.send.

Like send(String, int, String, Handler) but returns a Future of the asynchronous result

public DatagramSocket
send(String
the String to write
str
,
String
the 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 io.vertx.core.Handler to notify once the write completes.
handler
)

Implements io.vertx.core.datagram.DatagramSocket.send.

Write the given String to the io.vertx.core.net.SocketAddress using the given encoding.

public Future<Void>
send(String str, String enc, int port, String host)

Implements io.vertx.core.datagram.DatagramSocket.send.

Like send(String, String, int, String, Handler) but returns a Future of the asynchronous result

public WriteStream<Buffer>
sender(int
the port of the remote peer
port
,
String
the host address of the remote peer
host
)

Implements io.vertx.core.datagram.DatagramSocket.sender.

Returns a WriteStream<Buffer> able to send Buffer to the io.vertx.core.net.SocketAddress.

public DatagramSocket
unlistenMulticastGroup(String
the address of the multicast group to leave
multicastAddress
,
Handler<AsyncResult<Void>>
then handler to notify once the operation completes
handler
)

Implements io.vertx.core.datagram.DatagramSocket.unlistenMulticastGroup.

Leaves a multicast group and stops listening for packets send to it.

public Future<Void>
unlistenMulticastGroup(String multicastAddress)

Implements io.vertx.core.datagram.DatagramSocket.unlistenMulticastGroup.

Like unlistenMulticastGroup(String, Handler) but returns a Future of the asynchronous result

public DatagramSocket
unlistenMulticastGroup(String multicastAddress, String networkInterface, String source, Handler<AsyncResult<Void>> handler)

public Future<Void>
unlistenMulticastGroup(String multicastAddress, String networkInterface, @Nullable String source)

Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAlltoStringwaitwaitwait