class DatagramSocketDataEvent
package openfl.events
extends Event
Available on all platforms
A DatagramSocketDataEvent object is dispatched when Datagram socket has received data.
Static variables
staticinlineread onlyDATA:EventType<DatagramSocketDataEvent> = "data"
Defines the value of the type property of a data event object.
Constructor
new(type:String, bubbles:Bool = false, cancelable:Bool = false, srcAddress:String = "", srcPort:Int = 0, dstAddress:String = "", dstPort:Int = 0, ?data:ByteArray)
Creates an Event object that contains information about datagram events. Event objects are passed as parameters to event listeners.
Parameters:
type | The type of the event. Possible values are:DatagramSocketDataEvent.DATA |
---|---|
bubbles | Determines whether the Event object participates in the bubbling stage of the event flow. |
cancelable | Determines whether the Event object can be canceled. |
srcAddress | The IP address of the machine that sent the packet. |
srcPort | The port on the machine that sent the packet. |
dstAddress | The IP address to which the packet is addressed. |
dstPort | The port to which the packet is addressed. |
data | The datagram packet data. |
Variables
read onlydstAddress:String
The IP address of the DatagramSocket object that dispatched this event.
Note: If the socket is bound to the special address: 0.0.0.0, then this property will return 0.0.0.0. In order to know the specific IP to which the datagram message is sent, you must bind the socket to an explicit IP address.
Methods
clone():Event
Creates a copy of the DatagramSocketDataEvent object and sets each property's value to match that of the original.
Returns:
A new DatagramSocketDataEvent object with property values that match those of the original.
toString():String
Returns a string that contains all the properties of the DatagramSocketDataEvent object. The string is in the following format:
[DatagramSocketDataEvent type=value bubbles=value cancelable=value srcAddress=value srcPort=value dstAddress=value dstPort=value data=value]
Returns:
A string that contains all the properties of the ProgressEvent object.