vertx / io.vertx.rxjava.core.datagram / DatagramSocket

# DatagramSocket

`open class DatagramSocket : ReadStream<DatagramPacket>, Measured`

A datagram socket can be used to send io.vertx.rxjava.core.datagram.DatagramPacket's to remote datagram servers and receive io.vertx.rxjava.core.datagram.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.

NOTE: This class has been automatically generated from the io.vertx.core.datagram.DatagramSocket non RX-ified interface using Vert.x codegen.

### Constructors

<init> | `DatagramSocket(delegate: DatagramSocket)`

### Properties

__TYPE_ARG | `static val __TYPE_ARG: TypeArg<DatagramSocket>`

### Functions

blockMulticastGroup | `open fun blockMulticastGroup(multicastAddress: String, sourceToBlock: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Block the given address for the given multicast address and notifies the once the operation completes. `open fun blockMulticastGroup(multicastAddress: String, networkInterface: String, sourceToBlock: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
close | `open fun close(handler: Handler<AsyncResult<Void>>): Unit` Closes the io.vertx.rxjava.core.datagram.DatagramSocket implementation asynchronous and notifies the handler once done. `open fun close(): Unit` Closes the io.vertx.rxjava.core.datagram.DatagramSocket. The close itself is asynchronous.
endHandler | `open fun endHandler(endHandler: Handler<Void>): DatagramSocket`
equals | `open fun equals(other: Any?): Boolean`
exceptionHandler | `open fun exceptionHandler(handler: Handler<Throwable>): DatagramSocket`
getDelegate | `open fun getDelegate(): DatagramSocket`
handler | `open fun handler(handler: Handler<DatagramPacket>): DatagramSocket`
hashCode | `open fun hashCode(): Int`
isMetricsEnabled | `open fun isMetricsEnabled(): Boolean` Whether the metrics are enabled for this measured object
listen | `open fun listen(port: Int, host: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Start listening on the given port and host. The handler will be called when the socket is listening.
listenMulticastGroup | `open fun listenMulticastGroup(multicastAddress: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Joins a multicast group and listens for packets send to it. The is notified once the operation completes. `open fun listenMulticastGroup(multicastAddress: String, networkInterface: String, source: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes.
localAddress | `open fun localAddress(): SocketAddress` Return the io.vertx.rxjava.core.net.SocketAddress to which this io.vertx.rxjava.core.datagram.DatagramSocket is bound.
newInstance | `open static fun newInstance(arg: DatagramSocket): DatagramSocket`
pause | `open fun pause(): DatagramSocket`
resume | `open fun resume(): DatagramSocket`
rxBlockMulticastGroup | `open fun rxBlockMulticastGroup(multicastAddress: String, sourceToBlock: String): Single<DatagramSocket>` Block the given address for the given multicast address and notifies the once the operation completes. `open fun rxBlockMulticastGroup(multicastAddress: String, networkInterface: String, sourceToBlock: String): Single<DatagramSocket>` Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
rxClose | `open fun rxClose(): Single<Void>` Closes the io.vertx.rxjava.core.datagram.DatagramSocket implementation asynchronous and notifies the handler once done.
rxListen | `open fun rxListen(port: Int, host: String): Single<DatagramSocket>` Start listening on the given port and host. The handler will be called when the socket is listening.
rxListenMulticastGroup | `open fun rxListenMulticastGroup(multicastAddress: String): Single<DatagramSocket>` Joins a multicast group and listens for packets send to it. The is notified once the operation completes. `open fun rxListenMulticastGroup(multicastAddress: String, networkInterface: String, source: String): Single<DatagramSocket>` Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes.
rxSend | `open fun rxSend(packet: Buffer, port: Int, host: String): Single<DatagramSocket>` Write the given io.vertx.rxjava.core.buffer.Buffer to the io.vertx.rxjava.core.net.SocketAddress. The io.vertx.rxjava.core.Handler will be notified once the write completes. `open fun rxSend(str: String, port: Int, host: String): Single<DatagramSocket>` Write the given java.lang.String to the io.vertx.rxjava.core.net.SocketAddress using UTF8 encoding. The will be notified once the write completes. `open fun rxSend(str: String, enc: String, port: Int, host: String): Single<DatagramSocket>` Write the given java.lang.String to the io.vertx.rxjava.core.net.SocketAddress using the given encoding. The will be notified once the write completes.
rxUnlistenMulticastGroup | `open fun rxUnlistenMulticastGroup(multicastAddress: String): Single<DatagramSocket>` Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes. `open fun rxUnlistenMulticastGroup(multicastAddress: String, networkInterface: String, source: String): Single<DatagramSocket>` Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes.
send | `open fun send(packet: Buffer, port: Int, host: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Write the given io.vertx.rxjava.core.buffer.Buffer to the io.vertx.rxjava.core.net.SocketAddress. The io.vertx.rxjava.core.Handler will be notified once the write completes. `open fun send(str: String, port: Int, host: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Write the given java.lang.String to the io.vertx.rxjava.core.net.SocketAddress using UTF8 encoding. The will be notified once the write completes. `open fun send(str: String, enc: String, port: Int, host: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Write the given java.lang.String to the io.vertx.rxjava.core.net.SocketAddress using the given encoding. The will be notified once the write completes.
sender | `open fun sender(port: Int, host: String): WriteStream<Buffer>` Returns a `WriteStream` able to send to the io.vertx.rxjava.core.net.SocketAddress.
toObservable | `open fun toObservable(): Observable<DatagramPacket>`
toString | `open fun toString(): String`
unlistenMulticastGroup | `open fun unlistenMulticastGroup(multicastAddress: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes. `open fun unlistenMulticastGroup(multicastAddress: String, networkInterface: String, source: String, handler: Handler<AsyncResult<DatagramSocket>>): DatagramSocket` Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes.