grizzled.net

UDPDatagramSocket

object UDPDatagramSocket

Companion object for the UDPDatagramSocket trait, containing methods to simplify creation of UDPDatagramSocket objects, as well as some useful utility methods. See the documentation for the UDPDatagramSocket trait for a full treatment on this API.

See also

UDPDatagramSocket

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. UDPDatagramSocket
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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. def apply(): UDPDatagramSocket

    Create a UDP datagram socket object that's bound to any available local port and the wildcard IP address.

    Create a UDP datagram socket object that's bound to any available local port and the wildcard IP address. The broadcast flag will initially be clear.

    returns

    the UDPDatagramSocket object

  7. def apply(port: Int): UDPDatagramSocket

    Create a UDP datagram socket object that's bound to the specified local port and the wildcard IP address.

    Create a UDP datagram socket object that's bound to the specified local port and the wildcard IP address. The broadcast flag will initially be clear.

    port

    the local port

    returns

    the UDPDatagramSocket object

  8. def apply(address: IPAddress, port: Int): UDPDatagramSocket

    Create a UDP datagram socket object that's bound to the specified local port and IP address.

    Create a UDP datagram socket object that's bound to the specified local port and IP address. The broadcast flag will initially be clear.

    address

    the local IP address

    port

    the local port

    returns

    the UDPDatagramSocket object

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  20. def send(bytes: Seq[Byte], address: IPAddress, port: Int, broadcast: Boolean): Unit

    Utility method for sending a UDP packet.

    Utility method for sending a UDP packet. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    val broadcast: Boolean = ...
    
    // Set (or clear) the broadcast flag.
    socket.broadcast = broadcast
    
    // Send the bytes to the specified destination address and UDP port.
    socket.send(bytes, address, port)
    
    // Close the socket
    socket.close()
    bytes

    sequence of bytes to send

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

    broadcast

    whether or not to enable broadcast on the socket

  21. def send(bytes: Seq[Byte], address: IPAddress, port: Int): Unit

    Utility method for sending a non-broadcast UDP packet.

    Utility method for sending a non-broadcast UDP packet. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket.bind()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    
    // Send the bytes to the specified destination address and UDP port.
    socket.send(bytes, address, port)
    
    // Close the socket
    socket.close()
    bytes

    sequence of bytes to send

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

  22. def sendString(data: String, encoding: String, address: IPAddress, port: Int, broadcast: Boolean): Unit

    Utility method for sending a UDP packet consisting string data.

    Utility method for sending a UDP packet consisting string data. The string data is encoded the specified encoding before being sent. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    val encoding: String = ...
    val broadcast: Boolean = ...
    
    // Set (or clear) the broadcast flag.
    socket.broadcast = broadcast
    
    // Send the string to the specified destination address and UDP port.
    socket.send(string, encoding, address, port)
    
    // Close the socket
    socket.close()
    data

    String data to send

    encoding

    Encoding to use

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

    broadcast

    Whether to enable broadcast or not.

  23. def sendString(data: String, address: IPAddress, port: Int, broadcast: Boolean): Unit

    Utility method for sending a UDP packet consisting string data.

    Utility method for sending a UDP packet consisting string data. The string data is encoded in UTF-8 before being sent. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    val broadcast: Boolean = ...
    
    // Set (or clear) the broadcast flag.
    socket.broadcast = broadcast
    
    // Send the string to the specified destination address and UDP port.
    socket.send(string, address, port)
    
    // Close the socket
    socket.close()
    data

    String data to send

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

    broadcast

    Whether to enable broadcast or not.

  24. def sendString(data: String, address: IPAddress, port: Int): Unit

    Utility method for sending a non-broadcast UDP packet consisting of string data.

    Utility method for sending a non-broadcast UDP packet consisting of string data. The string data is encoded in UTF-8 before being sent. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket.bind()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    
    // Send the string to the specified destination address and UDP port.
    socket.send(string, address, port)
    
    // Close the socket
    socket.close()
    data

    String data to send

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

  25. def sendString(data: String, encoding: String, address: IPAddress, port: Int): Unit

    Utility method for sending a non-broadcast UDP packet consisting of string data.

    Utility method for sending a non-broadcast UDP packet consisting of string data. The string data is encoded the specified encoding before being sent. This method is equivalent to the following code snippet:

    // Bind to a local (source) UDP port.
    val socket = UDPDatagramSocket.bind()
    val address = IPAddress( /* details omitted */)
    val port: Int = ...
    val encoding: String = ...
    
    // Send the string to the specified destination address and UDP port.
    socket.send(string, encoding, address, port)
    
    // Close the socket
    socket.close()
    data

    String data to send

    encoding

    Encoding to use

    address

    IP address to which to send bytes

    port

    UDP port to which to send bytes

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped