org.vertx.scala.core.datagram

DatagramSocket

final class DatagramSocket extends Self with DrainSupport with NetworkSupport with ReadSupport[DatagramPacket] with Closeable

A Datagram socket which can be used to send org.vertx.scala.core.datagram.DatagramPacket's to remote Datagram servers and receive org.vertx.scala.core.datagram.DatagramPackets.

Usually you use a Datagram Client 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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DatagramSocket
  2. Closeable
  3. ReadSupport
  4. ExceptionSupport
  5. NetworkSupport
  6. DrainSupport
  7. AsJava
  8. Self
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type CloseType = AnyRef { ... /* 2 definitions in type refinement */ }

    Definition Classes
    Closeable
  2. type J = java.core.datagram.DatagramSocket

    The internal type of the Java wrapped class.

    The internal type of the Java wrapped class.

    Definition Classes
    DatagramSocketCloseableReadSupportExceptionSupportNetworkSupportDrainSupport → AsJava

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val asJava: java.core.datagram.DatagramSocket

    The internal instance of the Java wrapped class.

    The internal instance of the Java wrapped class.

    Definition Classes
    DatagramSocket → AsJava
  8. def blockMulticastGroup(multicastAddress: String, networkInterface: String, sourceToBlock: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Block the given sourceToBlock address for the given multicastAddress on the given network interface and notifies the handler once the operation completes.

    Block the given sourceToBlock address for the given multicastAddress on the given network interface and notifies the handler once the operation completes.

    multicastAddress

    the address for which you want to block the sourceToBlock

    networkInterface

    the network interface on which the blocking should accour.

    sourceToBlock

    the source address which should be blocked. You will not receive an multicast packets for it anymore.

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  9. def blockMulticastGroup(multicastAddress: String, sourceToBlock: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Block the given sourceToBlock address for the given multicastAddress and notifies the handler once the operation completes.

    Block the given sourceToBlock address for the given multicastAddress and notifies the handler once the operation completes.

    multicastAddress

    the address for which you want to block the sourceToBlock

    sourceToBlock

    the source address which should be blocked. You will not receive an multicast packets for it anymore.

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def close(handler: (AsyncResult[Void]) ⇒ Unit): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Definition Classes
    Closeable
  12. def close(): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Definition Classes
    Closeable
  13. def dataHandler(handler: (DatagramPacket) ⇒ Unit): DatagramSocket.this.type

    Set a data handler.

    Set a data handler. As data is read, the handler will be called with the data.

    Definition Classes
    DatagramSocketReadSupport
  14. def drainHandler(handler: ⇒ Unit): DatagramSocket.this.type

    Set a drain handler on the stream.

    Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue has been reduced to maxSize / 2. See Pump for an example of this being used.

    Definition Classes
    DrainSupport
  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  17. def exceptionHandler(handler: (Throwable) ⇒ Unit): DatagramSocket.this.type

    Set an exception handler.

    Set an exception handler.

    Definition Classes
    ExceptionSupport
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def getMulticastNetworkInterface: String

    Gets the java.net.StandardSocketOptions.IP_MULTICAST_IF option.

  21. def getMulticastTimeToLive: Int

    Gets the java.net.StandardSocketOptions.IP_MULTICAST_TTL option.

  22. def getReceiveBufferSize: Int

    returns

    The receive buffer size

    Definition Classes
    NetworkSupport
  23. def getSendBufferSize: Int

    returns

    The send buffer size

    Definition Classes
    NetworkSupport
  24. def getTrafficClass: Int

    returns

    the value of traffic class

    Definition Classes
    NetworkSupport
  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. def isBroadcast: Boolean

    Gets the java.net.StandardSocketOptions.SO_BROADCAST option.

  27. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  28. def isMulticastLoopbackMode: Boolean

    Gets the java.net.StandardSocketOptions.IP_MULTICAST_LOOP option.

    Gets the java.net.StandardSocketOptions.IP_MULTICAST_LOOP option.

    returns

    true if and only if the loopback mode has been disabled

  29. def isReuseAddress: Boolean

    returns

    The value of reuse address

    Definition Classes
    NetworkSupport
  30. def listen(local: InetSocketAddress, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Makes this org.vertx.scala.core.datagram.DatagramSocket} listen to the given java.net.InetSocketAddress.

    Makes this org.vertx.scala.core.datagram.DatagramSocket} listen to the given java.net.InetSocketAddress. Once the operation completes the handler is notified.

    local

    the java.net.InetSocketAddress on which the org.vertx.scala.core.datagram.DatagramSocket will listen for org.vertx.scala.core.datagram.DatagramPacket}s.

    handler

    the handler to notify once the operation completes

    returns

    this itself for method-chaining

  31. def listen(port: Int, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    See also

    org.vertx.java.core.Handler)

  32. def listen(address: String, port: Int, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    See also

    org.vertx.java.core.Handler)

  33. def listenMulticastGroup(multicastAddress: String, networkInterface: String, source: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

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

    Joins a multicast group and so start listen for packets send to it on the given network interface. The handler is notified once the operation completes.

    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 mulicast packets

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  34. def listenMulticastGroup(multicastAddress: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Joins a multicast group and so start listen for packets send to it.

    Joins a multicast group and so start listen for packets send to it. The handler is notified once the operation completes.

    multicastAddress

    the address of the multicast group to join

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  35. def localAddress(): InetSocketAddress

    Return the java.net.InetSocketAddress to which this org.vertx.scala.core.datagram.DatagramSocket is bound too.

  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  39. def pause(): DatagramSocket.this.type

    Pause the ReadSupport.

    Pause the ReadSupport. While it's paused, no data will be sent to the dataHandler

    Definition Classes
    ReadSupport
  40. def resume(): DatagramSocket.this.type

    Resume reading.

    Resume reading. If the ReadSupport has been paused, reading will recommence on it.

    Definition Classes
    ReadSupport
  41. def send(str: String, enc: String, host: String, port: Int, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Write the given String to the java.net.InetSocketAddress using the given encoding.

    Write the given String to the java.net.InetSocketAddress using the given encoding. The handler will be notified once write completes.

    str

    the String to write

    enc

    the charset used for encoding

    host

    the host address of the remote peer

    port

    the host port of the remote peer

    handler

    the handler to notify once the write completes.

    returns

    self itself for method chaining

  42. def send(str: String, host: String, port: Int, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Write the given String to the java.net.InetSocketAddress.

    Write the given String to the java.net.InetSocketAddress. The handler will be notified once write completes.

    str

    the String to write

    host

    the host address of the remote peer

    port

    the host port of the remote peer

    handler

    the handler to notify once the write completes.

    returns

    self itself for method chaining

  43. def send(packet: Buffer, host: String, port: Int, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Write the given org.vertx.scala.core.buffer.Buffer to the java.net.InetSocketAddress.

    Write the given org.vertx.scala.core.buffer.Buffer to the java.net.InetSocketAddress. The handler will be notified once write completes.

    packet

    the org.vertx.scala.core.buffer.Buffer to write

    host

    the host address of the remote peer

    port

    the host port of the remote peer

    handler

    the handler to notify once the write completes.

    returns

    self itself for method chaining

  44. def setBroadcast(broadcast: Boolean): DatagramSocket

    Sets the java.net.StandardSocketOptions.SO_BROADCAST option.

  45. def setMulticastLoopbackMode(loopbackModeDisabled: Boolean): DatagramSocket

    Sets the java.net.StandardSocketOptions.IP_MULTICAST_LOOP option.

    Sets the java.net.StandardSocketOptions.IP_MULTICAST_LOOP option.

    loopbackModeDisabled

    true if and only if the loopback mode has been disabled

  46. def setMulticastNetworkInterface(iface: String): DatagramSocket

    Sets the java.net.StandardSocketOptions.IP_MULTICAST_IF option.

  47. def setMulticastTimeToLive(ttl: Int): DatagramSocket

    Sets the java.net.StandardSocketOptions.IP_MULTICAST_TTL option.

  48. def setReceiveBufferSize(size: Int): DatagramSocket.this.type

    Set the receive buffer size for connections created by this instance to size in bytes.

    Set the receive buffer size for connections created by this instance to size in bytes.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  49. def setReuseAddress(reuse: Boolean): DatagramSocket.this.type

    Set the reuseAddress setting for connections created by this instance to reuse.

    Set the reuseAddress setting for connections created by this instance to reuse.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  50. def setSendBufferSize(size: Int): DatagramSocket.this.type

    Set the send buffer size for connections created by this instance to size in bytes.

    Set the send buffer size for connections created by this instance to size in bytes.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  51. def setTrafficClass(trafficClass: Int): DatagramSocket.this.type

    Set the trafficClass setting for connections created by this instance to trafficClass.

    Set the trafficClass setting for connections created by this instance to trafficClass.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  52. def setWriteQueueMaxSize(maxSize: Int): DatagramSocket.this.type

    Set the maximum size of the write queue to maxSize.

    Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize bytes in the write queue. This is used as an indicator by classes such as Pump to provide flow control.

    Definition Classes
    DrainSupport
  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def unlistenMulticastGroup(multicastAddress: String, networkInterface: String, source: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Leaves a multicast group and so stop listen for packets send to it on the given network interface.

    Leaves a multicast group and so stop listen for packets send to it on the given network interface. The handler is notified once the operation completes.

    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 mulicast packets

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  56. def unlistenMulticastGroup(multicastAddress: String, handler: (AsyncResult[DatagramSocket]) ⇒ Unit): DatagramSocket

    Leaves a multicast group and so stop listen for packets send to it.

    Leaves a multicast group and so stop listen for packets send to it. The handler is notified once the operation completes.

    multicastAddress

    the address of the multicast group to leave

    handler

    then handler to notify once the operation completes

    returns

    this returns itself for method-chaining

  57. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def wrap[X](doStuff: ⇒ X): DatagramSocket.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self
  61. def writeQueueFull: Boolean

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.DrainSupport.setWriteQueueMaxSize

    This will return true if there are more bytes in the write queue than the value set using org.vertx.scala.core.streams.DrainSupport.setWriteQueueMaxSize

    Definition Classes
    DrainSupport

Inherited from Closeable

Inherited from ReadSupport[DatagramPacket]

Inherited from ExceptionSupport

Inherited from NetworkSupport

Inherited from DrainSupport

Inherited from AsJava

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped