Copy link to clipboard
Copied
To replicate is easy
var datagram:DatagramSocket = new DatagramSocket();
datagram.bind();
datagram.receive();
var startTime:int = getTimer();
datagram.close();
trace("Time:", getTimer()-startTime);
Result: around 2001-2080
How to avoid this blocking?
Platform: Windows 7/10 Desktop
Copy link to clipboard
Copied
Hi there.
I tested this on macOS targeting AIR 28 for Desktop and received Time: 124:

I don't have access to a Windows system at the moment but will later today. Are there any other parameters regarding the FLA we should know about when testing?
Copy link to clipboard
Copied
I have also tested on macOS is exaclt 122-124ms/20-22ms
Even time consuming is less, still not acceptable for a function which only release a local port bind with nothing return?
Copy link to clipboard
Copied
I have found some looks very like the problem in crossbridge on github
crossbridge/javanet.c at f8c6eff42a2936d66c5a7aa1d5fbc35379985fb5 · adobe-flash/crossbridge · GitHub
_javanet_close:
while(error == TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL);
I found this conversion:
TARGET_NATIVE_ERROR_INTERRUPT_FUNCTION_CALL == EINTR
and
errno = EINTR in _recvfrom
crossbridge/javanet.c at f8c6eff42a2936d66c5a7aa1d5fbc35379985fb5 · adobe-flash/crossbridge · GitHub
TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_SO_TIMEOUT (fd, optval, result);
here just setup timeout for recvfrom
If the value are match, the case I describe must happen if these code are relevant.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more