stomp-js / stomp-websocket

Stomp client for Web browsers and node.js apps
https://stomp-js.github.io/stomp-websocket/
Apache License 2.0
141 stars 36 forks source link

closeEventCallback doesn't work with both connect signatures. #35

Closed zkendall closed 6 years ago

zkendall commented 6 years ago

Documentation says that these should both work.

client.connect(headers, connectCallback, errorCallback, closeEventCallback); client.connect(login, passcode, connectCallback, errorCallback, closeEventCallback);

However, in my code ONLY the SECOND one works.

So I converted:

_stomp.connect({}, connectCallback, errCallback, closeEventCallback);

to this:

_stomp.connect('', '', connectCallback, errCallback, closeEventCallback);

I determined this is what it was trying to do because with the first version, the closeEventCallback was being called with the error message typically sent to errCallback.

kum-deepak commented 6 years ago

I do realize it is a mess with so many alternate syntax. I am planning to make a non backward compatible change where all options are set and then connect is called without any parameters.

zkendall commented 6 years ago

Roger. Thanks.