io.vertx.rxjava.core.datagram

## Class DatagramSocket

- java.lang.Object
- - io.vertx.rxjava.core.datagram.DatagramSocket

- All Implemented Interfaces:
    Measured, ReadStream<DatagramPacket>, StreamBase

      public class DatagramSocket
      extends Object
      implements ReadStream<DatagramPacket>, Measured

  A datagram socket can be used to send `DatagramPacket`'s to remote datagram servers and receive `DatagramPacket`s .

  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 `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeArg<DatagramSocket>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatagramSocket(DatagramSocket delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `DatagramSocket` | `blockMulticastGroup(String multicastAddress, String sourceToBlock, Handler<AsyncResult<DatagramSocket>> handler)` Block the given address for the given multicast address and notifies the once the operation completes.
    `DatagramSocket` | `blockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock, Handler<AsyncResult<DatagramSocket>> handler)` Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
    `rx.Observable<DatagramSocket>` | `blockMulticastGroupObservable(String multicastAddress, String sourceToBlock)` Deprecated. use `rxBlockMulticastGroup(java.lang.String, java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `blockMulticastGroupObservable(String multicastAddress, String networkInterface, String sourceToBlock)` Deprecated. use `rxBlockMulticastGroup(java.lang.String, java.lang.String)` instead
    `void` | `close()` Closes the `DatagramSocket`.
    `void` | `close(Handler<AsyncResult<Void>> handler)` Closes the `DatagramSocket` implementation asynchronous and notifies the handler once done.
    `rx.Observable<Void>` | `closeObservable()` Deprecated. use `rxClose()` instead
    `DatagramSocket` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `DatagramSocket` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `DatagramSocket` | `getDelegate()`
    `DatagramSocket` | `handler(Handler<DatagramPacket> handler)` Set a data handler.
    `boolean` | `isMetricsEnabled()` Whether the metrics are enabled for this measured object
    `DatagramSocket` | `listen(int port, String host, Handler<AsyncResult<DatagramSocket>> handler)` Start listening on the given port and host.
    `DatagramSocket` | `listenMulticastGroup(String multicastAddress, Handler<AsyncResult<DatagramSocket>> handler)` Joins a multicast group and listens for packets send to it.
    `DatagramSocket` | `listenMulticastGroup(String multicastAddress, String networkInterface, String source, Handler<AsyncResult<DatagramSocket>> handler)` Joins a multicast group and listens for packets send to it on the given network interface.
    `rx.Observable<DatagramSocket>` | `listenMulticastGroupObservable(String multicastAddress)` Deprecated. use `rxListenMulticastGroup(java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `listenMulticastGroupObservable(String multicastAddress, String networkInterface, String source)` Deprecated. use `rxListenMulticastGroup(java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `listenObservable(int port, String host)` Deprecated. use `rxListen(int, java.lang.String)` instead
    `SocketAddress` | `localAddress()` Return the `SocketAddress` to which this `DatagramSocket` is bound.
    `static DatagramSocket` | `newInstance(DatagramSocket arg)`
    `DatagramSocket` | `pause()` Pause the `ReadSupport`.
    `DatagramSocket` | `resume()` Resume reading.
    `rx.Single<DatagramSocket>` | `rxBlockMulticastGroup(String multicastAddress, String sourceToBlock)` Block the given address for the given multicast address and notifies the once the operation completes.
    `rx.Single<DatagramSocket>` | `rxBlockMulticastGroup(String multicastAddress, String networkInterface, String sourceToBlock)` Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
    `rx.Single<Void>` | `rxClose()` Closes the `DatagramSocket` implementation asynchronous and notifies the handler once done.
    `rx.Single<DatagramSocket>` | `rxListen(int port, String host)` Start listening on the given port and host.
    `rx.Single<DatagramSocket>` | `rxListenMulticastGroup(String multicastAddress)` Joins a multicast group and listens for packets send to it.
    `rx.Single<DatagramSocket>` | `rxListenMulticastGroup(String multicastAddress, String networkInterface, String source)` Joins a multicast group and listens for packets send to it on the given network interface.
    `rx.Single<DatagramSocket>` | `rxSend(Buffer packet, int port, String host)` Write the given `Buffer` to the `SocketAddress`.
    `rx.Single<DatagramSocket>` | `rxSend(String str, int port, String host)` Write the given `String` to the `SocketAddress` using UTF8 encoding.
    `rx.Single<DatagramSocket>` | `rxSend(String str, String enc, int port, String host)` Write the given `String` to the `SocketAddress` using the given encoding.
    `rx.Single<DatagramSocket>` | `rxUnlistenMulticastGroup(String multicastAddress)` Leaves a multicast group and stops listening for packets send to it.
    `rx.Single<DatagramSocket>` | `rxUnlistenMulticastGroup(String multicastAddress, String networkInterface, String source)` Leaves a multicast group and stops listening for packets send to it on the given network interface.
    `DatagramSocket` | `send(Buffer packet, int port, String host, Handler<AsyncResult<DatagramSocket>> handler)` Write the given `Buffer` to the `SocketAddress`.
    `DatagramSocket` | `send(String str, int port, String host, Handler<AsyncResult<DatagramSocket>> handler)` Write the given `String` to the `SocketAddress` using UTF8 encoding.
    `DatagramSocket` | `send(String str, String enc, int port, String host, Handler<AsyncResult<DatagramSocket>> handler)` Write the given `String` to the `SocketAddress` using the given encoding.
    `WriteStream<Buffer>` | `sender(int port, String host)` Returns a `WriteStream` able to send to the `SocketAddress`.
    `rx.Observable<DatagramSocket>` | `sendObservable(Buffer packet, int port, String host)` Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `sendObservable(String str, int port, String host)` Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `sendObservable(String str, String enc, int port, String host)` Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
    `rx.Observable<DatagramPacket>` | `toObservable()`
    `DatagramSocket` | `unlistenMulticastGroup(String multicastAddress, Handler<AsyncResult<DatagramSocket>> handler)` Leaves a multicast group and stops listening for packets send to it.
    `DatagramSocket` | `unlistenMulticastGroup(String multicastAddress, String networkInterface, String source, Handler<AsyncResult<DatagramSocket>> handler)` Leaves a multicast group and stops listening for packets send to it on the given network interface.
    `rx.Observable<DatagramSocket>` | `unlistenMulticastGroupObservable(String multicastAddress)` Deprecated. use `rxUnlistenMulticastGroup(java.lang.String)` instead
    `rx.Observable<DatagramSocket>` | `unlistenMulticastGroupObservable(String multicastAddress, String networkInterface, String source)` Deprecated. use `rxUnlistenMulticastGroup(java.lang.String)` instead

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.ReadStream

      `newInstance, newInstance`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.StreamBase

      `newInstance`

    - ### Methods inherited from interface io.vertx.rxjava.core.metrics.Measured

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<DatagramSocket> __TYPE_ARG

  - ### Constructor Detail

    - #### DatagramSocket

          public DatagramSocket(DatagramSocket delegate)

  - ### Method Detail

    - #### getDelegate

          public DatagramSocket getDelegate()

      Specified by:
        `getDelegate` in interface `Measured`
      Specified by:
        `getDelegate` in interface `ReadStream<DatagramPacket>`
      Specified by:
        `getDelegate` in interface `StreamBase`

    - #### toObservable

          public rx.Observable<DatagramPacket> toObservable()

      Specified by:
        `toObservable` in interface `ReadStream<DatagramPacket>`

    - #### isMetricsEnabled

          public boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object
      Specified by:
        `isMetricsEnabled` in interface `Measured`
      Returns:
        true if the metrics are enabled

    - #### send

          public DatagramSocket send(Buffer packet,
                                     int port,
                                     String host,
                                     Handler<AsyncResult<DatagramSocket>> handler)

      Write the given `Buffer` to the `SocketAddress`. The `io.vertx.rxjava.core.Handler` will be notified once the write completes.
      Parameters:
        `packet` - the `Buffer` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
        `handler` - the `io.vertx.rxjava.core.Handler` to notify once the write completes.
      Returns:
        a reference to this, so the API can be used fluently

    - #### sendObservable

          @Deprecated
          public rx.Observable<DatagramSocket> sendObservable(Buffer packet,
                                                                          int port,
                                                                          String host)

      Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
      Write the given `Buffer` to the `SocketAddress`. The `io.vertx.rxjava.core.Handler` will be notified once the write completes.
      Parameters:
        `packet` - the `Buffer` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### rxSend

          public rx.Single<DatagramSocket> rxSend(Buffer packet,
                                                  int port,
                                                  String host)

      Write the given `Buffer` to the `SocketAddress`. The `io.vertx.rxjava.core.Handler` will be notified once the write completes.
      Parameters:
        `packet` - the `Buffer` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### sender

          public WriteStream<Buffer> sender(int port,
                                            String host)

      Returns a `WriteStream` able to send to the `SocketAddress`.
      Parameters:
        `port` - the port of the remote peer
        `host` - the host address of the remote peer
      Returns:
        the write stream for sending packets

    - #### send

          public DatagramSocket send(String str,
                                     int port,
                                     String host,
                                     Handler<AsyncResult<DatagramSocket>> handler)

      Write the given `String` to the `SocketAddress` using UTF8 encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
        `handler` - the `io.vertx.rxjava.core.Handler` to notify once the write completes.
      Returns:
        a reference to this, so the API can be used fluently

    - #### sendObservable

          @Deprecated
          public rx.Observable<DatagramSocket> sendObservable(String str,
                                                                          int port,
                                                                          String host)

      Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
      Write the given `String` to the `SocketAddress` using UTF8 encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### rxSend

          public rx.Single<DatagramSocket> rxSend(String str,
                                                  int port,
                                                  String host)

      Write the given `String` to the `SocketAddress` using UTF8 encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### send

          public DatagramSocket send(String str,
                                     String enc,
                                     int port,
                                     String host,
                                     Handler<AsyncResult<DatagramSocket>> handler)

      Write the given `String` to the `SocketAddress` using the given encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `enc` - the charset used for encoding
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
        `handler` - the `io.vertx.rxjava.core.Handler` to notify once the write completes.
      Returns:
        a reference to this, so the API can be used fluently

    - #### sendObservable

          @Deprecated
          public rx.Observable<DatagramSocket> sendObservable(String str,
                                                                          String enc,
                                                                          int port,
                                                                          String host)

      Deprecated. use `rxSend(io.vertx.rxjava.core.buffer.Buffer, int, java.lang.String)` instead
      Write the given `String` to the `SocketAddress` using the given encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `enc` - the charset used for encoding
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### rxSend

          public rx.Single<DatagramSocket> rxSend(String str,
                                                  String enc,
                                                  int port,
                                                  String host)

      Write the given `String` to the `SocketAddress` using the given encoding. The will be notified once the write completes.
      Parameters:
        `str` - the `String` to write
        `enc` - the charset used for encoding
        `port` - the host port of the remote peer
        `host` - the host address of the remote peer
      Returns:

    - #### close

          public void close(Handler<AsyncResult<Void>> handler)

      Closes the `DatagramSocket` implementation asynchronous and notifies the handler once done.
      Parameters:
        `handler` - the handler to notify once complete

    - #### closeObservable

          @Deprecated
          public rx.Observable<Void> closeObservable()

      Deprecated. use `rxClose()` instead
      Closes the `DatagramSocket` implementation asynchronous and notifies the handler once done.
      Returns:

    - #### rxClose

          public rx.Single<Void> rxClose()

      Closes the `DatagramSocket` implementation asynchronous and notifies the handler once done.
      Returns:

    - #### close

          public void close()

      Closes the `DatagramSocket`. The close itself is asynchronous.

    - #### localAddress

          public SocketAddress localAddress()

      Return the `SocketAddress` to which this `DatagramSocket` is bound.
      Returns:
        the socket address

    - #### listenMulticastGroup

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

      Joins a multicast group and listens for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `handler` - then handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> listenMulticastGroupObservable(String multicastAddress)

      Deprecated. use `rxListenMulticastGroup(java.lang.String)` instead
      Joins a multicast group and listens for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
      Returns:

    - #### rxListenMulticastGroup

          public rx.Single<DatagramSocket> rxListenMulticastGroup(String multicastAddress)

      Joins a multicast group and listens for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
      Returns:

    - #### listenMulticastGroup

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

      Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
        `handler` - then handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> listenMulticastGroupObservable(String multicastAddress,
                                                                                          String networkInterface,
                                                                                          String source)

      Deprecated. use `rxListenMulticastGroup(java.lang.String)` instead
      Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
      Returns:

    - #### rxListenMulticastGroup

          public rx.Single<DatagramSocket> rxListenMulticastGroup(String multicastAddress,
                                                                  String networkInterface,
                                                                  String source)

      Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
      Returns:

    - #### unlistenMulticastGroup

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

      Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to leave
        `handler` - then handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### unlistenMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> unlistenMulticastGroupObservable(String multicastAddress)

      Deprecated. use `rxUnlistenMulticastGroup(java.lang.String)` instead
      Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to leave
      Returns:

    - #### rxUnlistenMulticastGroup

          public rx.Single<DatagramSocket> rxUnlistenMulticastGroup(String multicastAddress)

      Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to leave
      Returns:

    - #### unlistenMulticastGroup

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

      Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
        `handler` - the handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### unlistenMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> unlistenMulticastGroupObservable(String multicastAddress,
                                                                                            String networkInterface,
                                                                                            String source)

      Deprecated. use `rxUnlistenMulticastGroup(java.lang.String)` instead
      Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
      Returns:

    - #### rxUnlistenMulticastGroup

          public rx.Single<DatagramSocket> rxUnlistenMulticastGroup(String multicastAddress,
                                                                    String networkInterface,
                                                                    String source)

      Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes.
      Parameters:
        `multicastAddress` - the address of the multicast group to join
        `networkInterface` - the network interface on which to listen for packets.
        `source` - the address of the source for which we will listen for multicast packets
      Returns:

    - #### blockMulticastGroup

          public DatagramSocket blockMulticastGroup(String multicastAddress,
                                                    String sourceToBlock,
                                                    Handler<AsyncResult<DatagramSocket>> handler)

      Block the given address for the given multicast address and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
        `handler` - the handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### blockMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> blockMulticastGroupObservable(String multicastAddress,
                                                                                         String sourceToBlock)

      Deprecated. use `rxBlockMulticastGroup(java.lang.String, java.lang.String)` instead
      Block the given address for the given multicast address and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
      Returns:

    - #### rxBlockMulticastGroup

          public rx.Single<DatagramSocket> rxBlockMulticastGroup(String multicastAddress,
                                                                 String sourceToBlock)

      Block the given address for the given multicast address and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
      Returns:

    - #### blockMulticastGroup

          public DatagramSocket blockMulticastGroup(String multicastAddress,
                                                    String networkInterface,
                                                    String sourceToBlock,
                                                    Handler<AsyncResult<DatagramSocket>> handler)

      Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `networkInterface` - the network interface on which the blocking should occur.
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
        `handler` - the handler to notify once the operation completes
      Returns:
        a reference to this, so the API can be used fluently

    - #### blockMulticastGroupObservable

          @Deprecated
          public rx.Observable<DatagramSocket> blockMulticastGroupObservable(String multicastAddress,
                                                                                         String networkInterface,
                                                                                         String sourceToBlock)

      Deprecated. use `rxBlockMulticastGroup(java.lang.String, java.lang.String)` instead
      Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `networkInterface` - the network interface on which the blocking should occur.
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
      Returns:

    - #### rxBlockMulticastGroup

          public rx.Single<DatagramSocket> rxBlockMulticastGroup(String multicastAddress,
                                                                 String networkInterface,
                                                                 String sourceToBlock)

      Block the given address for the given multicast address on the given network interface and notifies the once the operation completes.
      Parameters:
        `multicastAddress` - the address for which you want to block the source address
        `networkInterface` - the network interface on which the blocking should occur.
        `sourceToBlock` - the source address which should be blocked. You will not receive an multicast packets for it anymore.
      Returns:

    - #### listen

          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.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
        `handler` - the handler will be called when listening
      Returns:
        a reference to this, so the API can be used fluently

    - #### listenObservable

          @Deprecated
          public rx.Observable<DatagramSocket> listenObservable(int port,
                                                                            String host)

      Deprecated. use `rxListen(int, java.lang.String)` instead
      Start listening on the given port and host. The handler will be called when the socket is listening.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:

    - #### rxListen

          public rx.Single<DatagramSocket> rxListen(int port,
                                                    String host)

      Start listening on the given port and host. The handler will be called when the socket is listening.
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:

    - #### pause

          public DatagramSocket pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
      Specified by:
        `pause` in interface `ReadStream<DatagramPacket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          public DatagramSocket resume()

      Description copied from interface: `ReadStream`
      Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<DatagramPacket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          public DatagramSocket endHandler(Handler<Void> endHandler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<DatagramPacket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          public DatagramSocket handler(Handler<DatagramPacket> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<DatagramPacket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### exceptionHandler

          public DatagramSocket exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<DatagramPacket>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### newInstance

          public static DatagramSocket newInstance(DatagramSocket arg)

Copyright © 2017. All rights reserved.