Provides a User Datagram Protocol (UDP) socket. More...
Import Statement: | import ArcGIS.AppFramework.Networking 1.0 |
Inherits: |
Properties
- multicastInterface : NetworkInterface
Signals
- datagramReceived(object datagram, string address, ushort port)
Methods
- bool joinMulticastGroup(var groupAddress)
- bool joinMulticastGroup(var groupAddress, networkinterface networkInterface)
- bool leaveMulticastGroup(var groupAddress)
- bool leaveMulticastGroup(var groupAddress, networkinterface networkInterface)
- sendDatagram(var datagram, string address, ushort port)
Detailed Description
A subcomponent of AbstractSocket, the UdpSocket component provides a UDP (User Datagram Protocol) socket; a lightweight, unreliable, datagram-oriented protocol. It can be used when reliability isn't a priority.
This code sample from AppStudio Player demonsrates usage of UdpSocket, returning information from the SSDP listener when a datagram has been received.
UdpSocket { id: socket onDatagramReceived: { console.log("datagram: ", datagram); console.log("address: ", address); console.log("port: ", port); } onStateChanged: { console.log("SSDPListener status:", state); } onErrorChanged: { console.log("SSDPListener error:", error, errorString); } }
Property Documentation
multicastInterface : NetworkInterface |
Returns the interface for the outgoing interface for multicast datagrams.
Signal Documentation
Signal emitted when a datagram has been received.
Note: The corresponding handler is onDatagramReceived
.
Method Documentation
Joins the multicast group specified by groupAddress. Uses the default interface for the device.
The groupAddress parameter
IP or web address of multicast group to join.
Joins the multicast group specified by groupAddress, on the given interface.
The groupAddress parameter
IP or web address of multicast group to join.
The networkInterface parameter
The network interface to join the group on.
Leaves the multicast group specified by groupAddress. Uses the default interface for the device.
The groupAddress parameter
IP or web address of multicast group to leave.
Leaves the multicast group specified by groupAddress, on the given interface.
The groupAddress parameter
IP or web address of multicast group to leave.
The networkInterface parameter
The network interface to leave the group on.
Sends the held datagram to the given address, through the defined port.
The datagram parameter
The datagram you're sending.
The address parameter
The address you're sending the datagram to.
The port parameter
The name of the port to send the datagram through.