Opened 14 years ago

Closed 14 years ago

#4922 closed enhancement (fixed)

cometd state and id issues

Reported by: gregwilkins Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


This is an issue to encapsulate a number of minor issues with cometd (and to add a fix):

  • A connect response that arrives after a disconnect causes the connection state to be set as initialized.
  • the message id is numeric, while the spec says it may be alphanumeric.
  • the onUnload method prevents apps from doing bayeux operations in their own onUnload functions (as they are added after the cometd one).

Attachments (1)

cometd.patch (9.3 KB) - added by gregwilkins 14 years ago.

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by gregwilkins

Attachment: cometd.patch added


comment:1 Changed 14 years ago by gregwilkins

The attached patch addresses these issues:

  • The state booleans have been refactored to:
       DISCONNECTED:  _initialized==false && _connected==false
       CONNECTING:    _initialized==true  && _connected==false (handshake sent)
       CONNECTED:     _initialized==true  && _connected==true  (first successful connect)
       DISCONNECTING: _initialized==false && _connected==true  (disconnect sent)

what was called connected, is now _polling, as it is true only during the outstanding long poll (or forever frame) request.

  • The opportunity was taken to fix the coding standards for these fields (ie leading

_ for private fields).

  • The message ID fields is sent as a string rather than an int (as per the


  • The protocol version field is sent as a string rather than as a double (as per

the spec) and the version is now 1.0 with 0.9 being the minimum version

  • The onUnload function now just adds another onUnload function which does

the disconnect. This ensures that it is the last unload method that disconnects and others may perform bayeux operations.

comment:2 Changed 14 years ago by alex

Resolution: fixed
Status: newclosed

(In [11242]) merging another great patch from Greg Wilkins. Fixes #4922

Note: See TracTickets for help on using tickets.