You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DatagramSocket doesn't work in Worker for Linux platform.
Tested with DatagramSocket::send() and DatagramSocket.broadcast().
So right now there is no way to avoid UI blocking by intensive DatagramSocket usage.
Tested with multiple AIR versions, even with latest AIR 51.0.1.5 with multiple different Ubuntu 22.04 x86_64 devices and applications.
Same issue in all cases using DatagramSocket from Worker.
There is no such issue using DatagramSocket in main thread.
Also there is no such issues for Windows platform.
With another device launch any UDP server. You can use Windows device with UDP Test Utility https://udp-test-tool.informer.com/
Bind port 10000 (or another one).
In code below change remote IP address to IP address of device with UDP server. Also change port 10000 to another one if needed.
Launch application with this code with any Linux x86_64 device in the same local network. It should launch DatagramSocket in Worker and send UDP data to specified remote device every second.
package {
import flash.display.Sprite;
import flash.events.DatagramSocketDataEvent;
import flash.events.Event;
import flash.net.DatagramSocket;
import flash.system.Worker;
import flash.system.WorkerDomain;
import flash.utils.ByteArray;
import flash.utils.setInterval;
public class LinuxWorkerDatagramSocketBug extends Sprite {
private var _datagramSocket:DatagramSocket;
public function LinuxWorkerDatagramSocketBug() {
if (Worker.current.isPrimordial) {
addEventListener(Event.ADDED_TO_STAGE, init);
} else {
trace("worker");
_datagramSocket = new DatagramSocket();
_datagramSocket.bind(10000, "0.0.0.0");
_datagramSocket.addEventListener(DatagramSocketDataEvent.DATA, datagramSocket_data);
_datagramSocket.receive();
setInterval(send, 1000);
}
}
private function send():void {
trace("send");
var byteArray:ByteArray = new ByteArray();
byteArray.writeBoolean(true);
//Change IP address in line below according where client launched
_datagramSocket.send(byteArray, 0, 0, "192.168.3.2", 10000);
}
private function datagramSocket_data(e:DatagramSocketDataEvent):void {
trace("data: " + e.data.length);
}
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
var worker:Worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes, true);
worker.start();
}
}
}
Actual Result:
No data will be received by remote device.
In Scout we can see that data seems to be sent with no errors. But remote Windows device with UDP Test Utility didn't received it.
Expected Result:
Data sending via DatagramSocket from Worker works as expected. Remote device received data as with DatagramSocket usage in the main thread.
Known Workarounds
Use DatagramSocket in main thread but it could block UI with intensive UDP communication.
The text was updated successfully, but these errors were encountered:
Problem Description
DatagramSocket
doesn't work inWorker
for Linux platform.Tested with
DatagramSocket::send()
andDatagramSocket.broadcast()
.So right now there is no way to avoid UI blocking by intensive
DatagramSocket
usage.Tested with multiple AIR versions, even with latest AIR 51.0.1.5 with multiple different Ubuntu 22.04 x86_64 devices and applications.
Same issue in all cases using
DatagramSocket
fromWorker
.There is no such issue using
DatagramSocket
in main thread.Also there is no such issues for Windows platform.
Related issues:
#580
https://tracker.adobe.com/#/view/AIR-4198607
https://tracker.adobe.com/#/view/AIR-4198606
Steps to Reproduce
Bind port
10000
(or another one).10000
to another one if needed.DatagramSocket
inWorker
and send UDP data to specified remote device every second.Application example with sources attached.
linux_worker_datagram_socket_bug.zip
Actual Result:
No data will be received by remote device.
In Scout we can see that data seems to be sent with no errors. But remote Windows device with UDP Test Utility didn't received it.
Expected Result:
Data sending via
DatagramSocket
fromWorker
works as expected. Remote device received data as withDatagramSocket
usage in the main thread.Known Workarounds
Use
DatagramSocket
in main thread but it could block UI with intensive UDP communication.The text was updated successfully, but these errors were encountered: