Loading ...
Sorry, an error occurred while loading the content.

Problem with Connection Manager - isCallInProcess

Expand Messages
  • David Prusak
    Hi all, Once in a while, I get a javascript error when I try and get a status of a connection. The javascript error I get is: o.conn is undefined.
    Message 1 of 2 , Mar 2 12:54 AM
    • 0 Attachment
      Hi all,

      Once in a while, I get a javascript error when I try and get a
      status of a connection.

      The javascript error I get is:

      o.conn is undefined.

      isCallInProgress:function(o){
      if(o){
      return o.conn.readyState != 4 && o.conn.readyState != 0;
      }
      }

      I believe what is happening is that if the connection is complete,
      the o.conn propery is removed or deleted somehow. "o" still exists,
      but there is no conn property.

      I have a workaround in my local code that checks for o.conn, and if
      it exists, then call isCallInProgress. If not, I assume that the
      connection has completed and continue.

      Hope that makes sense.

      Thanks!
      --David
    • Thomas S. Sha
      ... Your assessment is spot on, and your proposed fix will remove the error. Thanks for posting this. This is the proposed revision for the next release.
      Message 2 of 2 , Mar 2 8:46 AM
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "David Prusak" <dprusak@...> wrote:
        >
        > Hi all,
        >
        > Once in a while, I get a javascript error when I try and get a
        > status of a connection.
        >
        > The javascript error I get is:
        >
        > o.conn is undefined.
        >
        > isCallInProgress:function(o){
        > if(o){
        > return o.conn.readyState != 4 && o.conn.readyState != 0;
        > }
        > }
        >
        > I believe what is happening is that if the connection is complete,
        > the o.conn propery is removed or deleted somehow. "o" still exists,
        > but there is no conn property.
        >
        > I have a workaround in my local code that checks for o.conn, and if
        > it exists, then call isCallInProgress. If not, I assume that the
        > connection has completed and continue.
        >
        > Hope that makes sense.
        >
        > Thanks!
        > --David

        Your assessment is spot on, and your proposed fix will remove the
        error. Thanks for posting this.

        This is the proposed revision for the next release.

        isCallInProgress:function(o){
        if(o.conn){
        return o.conn.readyState != 4 && o.conn.readyState != 0;
        }
        else{
        // The transaction has completed and the object destroyed.
        return false;
        }
        }

        Regards,
        Thomas
      Your message has been successfully submitted and would be delivered to recipients shortly.