Packages

class DatagramSocket extends ReadStream[DatagramPacket] with Measured

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

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DatagramSocket
  2. Measured
  3. ReadStream
  4. StreamBase
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DatagramSocket(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
    Definition Classes
    DatagramSocketMeasuredReadStreamStreamBase
  6. def 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.

    Block the given address for the given multicast address on the given network interface and notifies the once the operation completes. * @param 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

  7. def 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.

    Block the given address for the given multicast address and notifies the once the operation completes. * @param 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

  8. def blockMulticastGroupFuture(multicastAddress: String, networkInterface: String, sourceToBlock: String): scala.concurrent.Future[DatagramSocket]

    Like blockMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  9. def blockMulticastGroupFuture(multicastAddress: String, sourceToBlock: String): scala.concurrent.Future[DatagramSocket]

    Like blockMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. def close(): Unit

    Closes the io.vertx.scala.core.datagram.DatagramSocket.

    Closes the io.vertx.scala.core.datagram.DatagramSocket. The close itself is asynchronous.

  12. def close(handler: Handler[AsyncResult[Unit]]): Unit

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

    Closes the io.vertx.scala.core.datagram.DatagramSocket implementation asynchronous and notifies the handler once done. * @param handler the handler to notify once complete

  13. def closeFuture(): scala.concurrent.Future[Unit]

    Like close but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  14. def endHandler(endHandler: Handler[Unit]): DatagramSocket

    Set an end handler.

    Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called. * @return a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStream
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def exceptionHandler(handler: Handler[Throwable]): DatagramSocket

    Set an exception handler on the read stream.

    Set an exception handler on the read stream. * @param handler the exception handler

    returns

    a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStreamStreamBase
  18. def fetch(amount: Long): DatagramSocket

    Fetch the specified amount of elements.

    Fetch the specified amount of elements. If the ReadStream has been paused, reading will recommence with the specified amount of items, otherwise the specified amount will be added to the current stream demand. * @return a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStream
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def handler(handler: Handler[DatagramPacket]): DatagramSocket

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data. * @return a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStream
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def isMetricsEnabled(): Boolean

    Whether the metrics are enabled for this measured object * @return true if metrics are enabled

    Whether the metrics are enabled for this measured object * @return true if metrics are enabled

    Definition Classes
    DatagramSocketMeasured
  25. def listen(port: Int, host: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

    Start listening on the given port and host.

    Start listening on the given port and host. The handler will be called when the socket is listening. * @param 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

  26. def listenFuture(port: Int, host: String): scala.concurrent.Future[DatagramSocket]

    Like listen but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  27. def listenMulticastGroup(multicastAddress: String, networkInterface: String, source: Option[String], handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

    Joins a multicast group and listens for packets send to it on the given network interface.

    Joins a multicast group and listens for packets send to it on the given network interface. The is notified once the operation completes. * @param 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

  28. def listenMulticastGroup(multicastAddress: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

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

    Joins a multicast group and listens for packets send to it. The is notified once the operation completes. * @param 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

  29. def listenMulticastGroupFuture(multicastAddress: String, networkInterface: String, source: Option[String]): scala.concurrent.Future[DatagramSocket]

    Like listenMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  30. def listenMulticastGroupFuture(multicastAddress: String): scala.concurrent.Future[DatagramSocket]

    Like listenMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  31. def localAddress(): SocketAddress

    Return the io.vertx.scala.core.net.SocketAddress to which this io.vertx.scala.core.datagram.DatagramSocket is bound.

    Return the io.vertx.scala.core.net.SocketAddress to which this io.vertx.scala.core.datagram.DatagramSocket is bound. * @return the socket address

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def pause(): DatagramSocket

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

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

    While it's paused, no data will be sent to the data handler. * @return a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStream
  36. def resume(): DatagramSocket

    Resume reading, and sets the buffer in flowing mode.

    Resume reading, and sets the buffer in flowing mode.

    If the ReadStream has been paused, reading will recommence on it. * @return a reference to this, so the API can be used fluently

    Definition Classes
    DatagramSocketReadStream
  37. def send(str: String, enc: String, port: Int, host: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

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

    Write the given String to the io.vertx.scala.core.net.SocketAddress using the given encoding. The will be notified once the write completes. * @param 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 scala-function to notify once the write completes.

    returns

    a reference to this, so the API can be used fluently

  38. def send(str: String, port: Int, host: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

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

    Write the given String to the io.vertx.scala.core.net.SocketAddress using UTF8 encoding. The will be notified once the write completes. * @param str the String to write

    port

    the host port of the remote peer

    host

    the host address of the remote peer

    handler

    the scala-function to notify once the write completes.

    returns

    a reference to this, so the API can be used fluently

  39. def send(packet: Buffer, port: Int, host: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

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

    Write the given io.vertx.scala.core.buffer.Buffer to the io.vertx.scala.core.net.SocketAddress. The scala-function will be notified once the write completes. * @param packet the io.vertx.scala.core.buffer.Buffer to write

    port

    the host port of the remote peer

    host

    the host address of the remote peer

    handler

    the scala-function to notify once the write completes.

    returns

    a reference to this, so the API can be used fluently

  40. def sendFuture(str: String, enc: String, port: Int, host: String): scala.concurrent.Future[DatagramSocket]

    Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  41. def sendFuture(str: String, port: Int, host: String): scala.concurrent.Future[DatagramSocket]

    Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  42. def sendFuture(packet: Buffer, port: Int, host: String): scala.concurrent.Future[DatagramSocket]

    Like send but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  43. def sender(port: Int, host: String): WriteStream[Buffer]

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

    Returns a WriteStream<Buffer> able to send to the io.vertx.scala.core.net.SocketAddress. * @param port the port of the remote peer

    host

    the host address of the remote peer

    returns

    the write stream for sending packets

  44. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def unlistenMulticastGroup(multicastAddress: String, networkInterface: String, source: Option[String], handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

    Leaves a multicast group and stops listening for packets send to it on the given network interface.

    Leaves a multicast group and stops listening for packets send to it on the given network interface. The is notified once the operation completes. * @param 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

  47. def unlistenMulticastGroup(multicastAddress: String, handler: Handler[AsyncResult[DatagramSocket]]): DatagramSocket

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

    Leaves a multicast group and stops listening for packets send to it. The is notified once the operation completes. * @param 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

  48. def unlistenMulticastGroupFuture(multicastAddress: String, networkInterface: String, source: Option[String]): scala.concurrent.Future[DatagramSocket]

    Like unlistenMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  49. def unlistenMulticastGroupFuture(multicastAddress: String): scala.concurrent.Future[DatagramSocket]

    Like unlistenMulticastGroup but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  50. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Measured

Inherited from ReadStream[DatagramPacket]

Inherited from StreamBase

Inherited from AnyRef

Inherited from Any

Ungrouped