Skip to main content
Known Participant
March 3, 2017
Question

DatagramSocket#close() takes 2 seconds

  • March 3, 2017
  • 13 replies
  • 1370 views

Hi,

I'm using UDP sockets in my project, and I found that when I close a DatagramSocket, my app freezes for approximatly 2 seconds

I have no idea why this is happening, is it a bug? is there a workaround?

here is a sample code that reproduces the issue:

var s:DatagramSocket = new DatagramSocket();

s.bind();

s.connect("127.0.0.1",9977);

s.receive();

setTimeout(function():void {

    var t:int = getTimer();

    s.close();

    trace((getTimer()-t)+"ms"); // prints "2000ms"

}, 1000);

PS: Also, it would be great if multicast was supported with AIR DatagramSocket!

This topic has been closed for replies.

13 replies

PhendraxAuthor
Known Participant
March 29, 2017

Up....

PhendraxAuthor
Known Participant
March 15, 2017

Up \o/

PhendraxAuthor
Known Participant
March 9, 2017

Up, maybe