0 Replies Latest reply on Jan 9, 2011 8:00 PM by sweetradio

    air.Event.CLOSE event does not occur immediately

    sweetradio

      when a connected socket is closing, an air.Event.CLOSE event does not occur immediately.

      maybe it seems not to occur.

      how can i capture socket closing event?

       

      var socket = new air.Socket();

       

      socket.addEventListener( air.Event.CLOSE, onDisconnect );

      socket.addEventListener( air.Event.CONNECT, onConnect );

      socket.addEventListener( air.ProgressEvent.SOCKET_DATA, onSocketData );

      var onDisconnect = function(event) {
            alert('socket is closed by server');
      },