autobahn js onclose not triggered?

#1

Hi,

I’m testing error reporting / automatic reconnections for autobahn js connections.

I’m running crossbar as a router, with autobahn version 0.9.3 for both server side and browser side scripts.

In the browser everything seems to work as expected and as per the documentation. So it connects to crossbar, and if I then kill crossbar, the connection is retried as per max_retries etc

However if I try this simple server side script:

var autobahn = require(‘autobahn’);

var connection = new autobahn.Connection({

url: ‘ws://localhost:8080/ws’,

realm: ‘tutorialrpc’}

  );

connection.onopen = function (session) {

console.log(“Open”);

};

connection.onclose = function (reason, details) {

console.log(“Close”);

};

connection.open();

Connection establishes OK. Get “Open” mesage.

Kill crossbar.

No “Close” message & the script ends

So it seems that onclose isnt being triggered?

Any clues?

Cheers

Mike

0 Likes

#2

Hi Mike,

I'm testing error reporting / automatic reconnections for autobahn js
connections.

I'm running crossbar as a router, with autobahn version 0.9.3 for both
server side and browser side scripts.
In the browser everything seems to work as expected and as per the
documentation. So it connects to crossbar, and if I then kill crossbar,
the connection is retried as per max_retries etc
However if I try this simple server side script:

..

No "Close" message & the script ends

So it seems that onclose isnt being triggered?

This was a bug I justed fixed:

https://github.com/tavendo/AutobahnJS/issues/91

Could you test (using trunk from Git) again?

Thanks for reporting!

/Tobias

···

Any clues?

Cheers

Mike

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

Hi Tobias,

OK I tried that - up until now I’ve used NPM so there is a chance I’ve messed something up building from scratch - but following the process here:

http://autobahn.ws/js/building.html

I do end up with a new autobahn.js file which I point to in my script changing
var autobahn = require(‘autobahn’);

to
var autobahn = require(’…/…/autobahn.js’);

Starting the script I get this error:

$ node logging_server.js

/home/mike/Desktop/crossbar/autobahn.js:811
console>>(console = window.console = {
^
ReferenceError: window is not defined

at /home/mike/Desktop/crossbar/autobahn.js:811:24
at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:900:3)
at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:901:4)

at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)
at /home/mike/Desktop/crossbar/autobahn.js:1:659
at Object../polyfill/array (/home/mike/Desktop/crossbar/autobahn.js:673:1)
at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)

at /home/mike/Desktop/crossbar/autobahn.js:1:659
at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:112:1)
at Object.../package.json (/home/mike/Desktop/crossbar/autobahn.js:159:4)

Cheers

Mike

···

On Mon, Jun 30, 2014 at 4:49 PM, Tobias Oberstein tobias.o...@gmail.com wrote:

Hi Mike,

I’m testing error reporting / automatic reconnections for autobahn js

connections.

I’m running crossbar as a router, with autobahn version 0.9.3 for both

server side and browser side scripts.

In the browser everything seems to work as expected and as per the

documentation. So it connects to crossbar, and if I then kill crossbar,

the connection is retried as per max_retries etc

However if I try this simple server side script:

No “Close” message & the script ends

So it seems that onclose isnt being triggered?

This was a bug I justed fixed:

https://github.com/tavendo/AutobahnJS/issues/91

Could you test (using trunk from Git) again?

Thanks for reporting!

/Tobias

Any clues?

Cheers

Mike

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+unsubscribe@googlegroups.com

mailto:autobahnws+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

0 Likes

#4

Hi Mike,

Hi Tobias,

OK I tried that - up until now I've used NPM so there is a chance I've
messed something up building from scratch - but following the process here:

http://autobahn.ws/js/building.html

This is for building the _browser_ version (we should make that fact more prominent).

For Node, there isn't anything to build. Just require from the checked out repository:

var autobahn = require('./AutobahnJS/package/index.js');

in your test script.

/Tobias

···

Am 01.07.2014 10:12, schrieb Mike Raistrick:

I do end up with a new autobahn.js file which I point to in my script
changing
var autobahn = require('autobahn');
to
var autobahn = require('../../autobahn.js');

Starting the script I get this error:

$ node logging_server.js

/home/mike/Desktop/crossbar/autobahn.js:811
    console>>(console = window.console = {
                        ^
ReferenceError: window is not defined
     at /home/mike/Desktop/crossbar/autobahn.js:811:24
     at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:900:3)
     at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:901:4)
     at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)
     at /home/mike/Desktop/crossbar/autobahn.js:1:659
     at Object../polyfill/array
(/home/mike/Desktop/crossbar/autobahn.js:673:1)
     at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)
     at /home/mike/Desktop/crossbar/autobahn.js:1:659
     at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:112:1)
     at Object.../package.json
(/home/mike/Desktop/crossbar/autobahn.js:159:4)

Cheers

Mike

On Mon, Jun 30, 2014 at 4:49 PM, Tobias Oberstein > <tobias.o...@gmail.com <mailto:tobias.o...@gmail.com>> wrote:

    Hi Mike,

        I'm testing error reporting / automatic reconnections for
        autobahn js
        connections.

        I'm running crossbar as a router, with autobahn version 0.9.3
        for both
        server side and browser side scripts.
        In the browser everything seems to work as expected and as per the
        documentation. So it connects to crossbar, and if I then kill
        crossbar,
        the connection is retried as per max_retries etc
        However if I try this simple server side script:

    ..

        No "Close" message & the script ends

        So it seems that onclose isnt being triggered?

    This was a bug I justed fixed:

    https://github.com/tavendo/__AutobahnJS/issues/91
    <https://github.com/tavendo/AutobahnJS/issues/91>

    Could you test (using trunk from Git) again?

    Thanks for reporting!

    /Tobias

        Any clues?

        Cheers

        Mike

        --
        You received this message because you are subscribed to the Google
        Groups "Autobahn" group.
        To unsubscribe from this group and stop receiving emails from
        it, send
        an email to autobahnws+unsubscribe@__googlegroups.com
        <mailto:autobahnws%2...@googlegroups.com>
        <mailto:autobahnws+_...@googlegroups.com
        <mailto:autobahnws%2...@googlegroups.com>>.

        For more options, visit https://groups.google.com/d/__optout
        <https://groups.google.com/d/optout>.

    --
    You received this message because you are subscribed to the Google
    Groups "Autobahn" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to autobahnws+unsubscribe@__googlegroups.com
    <mailto:autobahnws%2...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/__optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#5

Hi Tobias,

ah OK - thanks.

So with a fresh github download and:

var autobahn = require(’./AutobahnJS/package/index.js’);

I was getting

/AutobahnJS/package/lib/connection.js:146

throw “could not create a transport”;

until I ran

/AutobahnJS/package$ npm install

After that everything is fine and it automatically re-connects to the Crossbar router as expected.

Thanks again,

Mike

···

On Tue, Jul 1, 2014 at 12:44 PM, Tobias Oberstein tobias.o...@gmail.com wrote:

Hi Mike,

Am 01.07.2014 10:12, schrieb Mike Raistrick:

Hi Tobias,

OK I tried that - up until now I’ve used NPM so there is a chance I’ve

messed something up building from scratch - but following the process here:

http://autobahn.ws/js/building.html

This is for building the browser version (we should make that fact more prominent).

For Node, there isn’t anything to build. Just require from the checked out repository:

var autobahn = require(’./AutobahnJS/package/index.js’);

in your test script.

/Tobias

I do end up with a new autobahn.js file which I point to in my script

changing

var autobahn = require(‘autobahn’);

to

var autobahn = require(’…/…/autobahn.js’);

Starting the script I get this error:

$ node logging_server.js

/home/mike/Desktop/crossbar/autobahn.js:811

console||(console = window.console = {

                    ^

ReferenceError: window is not defined

 at /home/mike/Desktop/crossbar/autobahn.js:811:24

 at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:900:3)

 at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:901:4)

 at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)

 at /home/mike/Desktop/crossbar/autobahn.js:1:659

 at Object../polyfill/array

(/home/mike/Desktop/crossbar/autobahn.js:673:1)

 at s (/home/mike/Desktop/crossbar/autobahn.js:1:608)

 at /home/mike/Desktop/crossbar/autobahn.js:1:659

 at Object.<anonymous> (/home/mike/Desktop/crossbar/autobahn.js:112:1)

 at Object.../package.json

(/home/mike/Desktop/crossbar/autobahn.js:159:4)

Cheers

Mike

On Mon, Jun 30, 2014 at 4:49 PM, Tobias Oberstein

<tobias.o...@gmail.com mailto:tobias.oberstein@gmail.com> wrote:

Hi Mike,





    I'm testing error reporting / automatic reconnections for

    autobahn js

    connections.



    I'm running crossbar as a router, with autobahn version 0.9.3

    for both

    server side and browser side scripts.

    In the browser everything seems to work as expected and as per the

    documentation. So it connects to crossbar, and if I then kill

    crossbar,

    the connection is retried as per max_retries etc

    However if I try this simple server side script:



..



    No "Close" message & the script ends



    So it seems that onclose  isnt being triggered?





This was a bug I justed fixed:

https://github.com/tavendo/__AutobahnJS/issues/91

<[https://github.com/tavendo/AutobahnJS/issues/91](https://github.com/tavendo/AutobahnJS/issues/91)>



Could you test (using trunk from Git) again?



Thanks for reporting!



/Tobias





    Any clues?



    Cheers



    Mike



    --

    You received this message because you are subscribed to the Google

    Groups "Autobahn" group.

    To unsubscribe from this group and stop receiving emails from

    it, send

an email to autobahnws+unsubscribe@__googlegroups.com

    <mailto:autobahnws%2Bunsu...@googlegroups.com>

    <mailto:autobahnws+__unsub...@googlegroups.com

    <mailto:autobahnws%2Bunsu...@googlegroups.com>>.



    For more options, visit [https://groups.google.com/d/__optout](https://groups.google.com/d/__optout)

    <[https://groups.google.com/d/optout](https://groups.google.com/d/optout)>.






--

You received this message because you are subscribed to the Google

Groups "Autobahn" group.

To unsubscribe from this group and stop receiving emails from it,

send an email to autobahnws+unsubscribe@__googlegroups.com

<mailto:autobahnws%2Bunsu...@googlegroups.com>.

For more options, visit [https://groups.google.com/d/__optout](https://groups.google.com/d/__optout)

<[https://groups.google.com/d/optout](https://groups.google.com/d/optout)>.

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+unsubscribe@googlegroups.com

mailto:autobahnws+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

0 Likes

#6

Hi Mike,

it works for you .. great! We'll do a new release of AutobahnJS soon (and then it'll be on npm also ready to install from there).

Thanks for reporting this issue,
/Tobias

···

Am 01.07.2014 14:50, schrieb Mike Raistrick:

Hi Tobias,

ah OK - thanks.

So with a fresh github download and:
var autobahn = require('./AutobahnJS/package/index.js');

I was getting

/AutobahnJS/package/lib/connection.js:146
throw "could not create a transport";

until I ran
/AutobahnJS/package$ npm install

After that everything is fine and it automatically re-connects to the
Crossbar router as expected.

Thanks again,

Mike

On Tue, Jul 1, 2014 at 12:44 PM, Tobias Oberstein > <tobias.o...@gmail.com <mailto:tobias.o...@gmail.com>> wrote:

    Hi Mike,

    Am 01.07.2014 10:12, schrieb Mike Raistrick:

        Hi Tobias,

        OK I tried that - up until now I've used NPM so there is a
        chance I've
        messed something up building from scratch - but following the
        process here:

        http://autobahn.ws/js/__building.html
        <http://autobahn.ws/js/building.html>

    This is for building the _browser_ version (we should make that fact
    more prominent).

    For Node, there isn't anything to build. Just require from the
    checked out repository:

    var autobahn = require('./AutobahnJS/package/__index.js');

    in your test script.

    /Tobias

        I do end up with a new autobahn.js file which I point to in my
        script
        changing
        var autobahn = require('autobahn');
        to
        var autobahn = require('../../autobahn.js');

        Starting the script I get this error:

        $ node logging_server.js

        /home/mike/Desktop/crossbar/__autobahn.js:811
             console>>(console = window.console = {
                                 ^
        ReferenceError: window is not defined
              at /home/mike/Desktop/crossbar/__autobahn.js:811:24
              at Object.<anonymous>
        (/home/mike/Desktop/crossbar/__autobahn.js:900:3)
              at Object.<anonymous>
        (/home/mike/Desktop/crossbar/__autobahn.js:901:4)
              at s (/home/mike/Desktop/crossbar/__autobahn.js:1:608)
              at /home/mike/Desktop/crossbar/__autobahn.js:1:659
              at Object../polyfill/array
        (/home/mike/Desktop/crossbar/__autobahn.js:673:1)
              at s (/home/mike/Desktop/crossbar/__autobahn.js:1:608)
              at /home/mike/Desktop/crossbar/__autobahn.js:1:659
              at Object.<anonymous>
        (/home/mike/Desktop/crossbar/__autobahn.js:112:1)
              at Object.../package.json
        (/home/mike/Desktop/crossbar/__autobahn.js:159:4)

        Cheers

        Mike

        On Mon, Jun 30, 2014 at 4:49 PM, Tobias Oberstein > <tobias.o...@gmail.com <mailto:tobias.o...@gmail.com> > <mailto:tobias.o...@__gmail.com > <mailto:tobias.o...@gmail.com>>> wrote:

             Hi Mike,

                 I'm testing error reporting / automatic reconnections for
                 autobahn js
                 connections.

                 I'm running crossbar as a router, with autobahn version
        0.9.3
                 for both
                 server side and browser side scripts.
                 In the browser everything seems to work as expected and
        as per the
                 documentation. So it connects to crossbar, and if I
        then kill
                 crossbar,
                 the connection is retried as per max_retries etc
                 However if I try this simple server side script:

             ..

                 No "Close" message & the script ends

                 So it seems that onclose isnt being triggered?

             This was a bug I justed fixed:

        https://github.com/tavendo/____AutobahnJS/issues/91
        <https://github.com/tavendo/__AutobahnJS/issues/91>

             <https://github.com/tavendo/__AutobahnJS/issues/91
        <https://github.com/tavendo/AutobahnJS/issues/91>>

             Could you test (using trunk from Git) again?

             Thanks for reporting!

             /Tobias

                 Any clues?

                 Cheers

                 Mike

                 --
                 You received this message because you are subscribed to
        the Google
                 Groups "Autobahn" group.
                 To unsubscribe from this group and stop receiving
        emails from
                 it, send
                 an email to autobahnws+unsubscribe@__googl__egroups.com
        <http://googlegroups.com>
                 <mailto:autobahnws%__...@googlegroups.com
        <mailto:autobahnws%25...@googlegroups.com>__>
                 <mailto:autobahnws+__...@googlegroups.com
        <mailto:autobahnws%2B...@googlegroups.com>
                 <mailto:autobahnws%__...@googlegroups.com
        <mailto:autobahnws%25...@googlegroups.com>__>>.

                 For more options, visit
        https://groups.google.com/d/____optout
        <https://groups.google.com/d/__optout>
                 <https://groups.google.com/d/__optout
        <https://groups.google.com/d/optout>>.

             --
             You received this message because you are subscribed to the
        Google
             Groups "Autobahn" group.
             To unsubscribe from this group and stop receiving emails
        from it,
             send an email to
        autobahnws+unsubscribe@__googl__egroups.com
        <http://googlegroups.com>
             <mailto:autobahnws%__...@googlegroups.com
        <mailto:autobahnws%25...@googlegroups.com>__>.
             For more options, visit
        https://groups.google.com/d/____optout
        <https://groups.google.com/d/__optout>
             <https://groups.google.com/d/__optout
        <https://groups.google.com/d/optout>>.

        --
        You received this message because you are subscribed to the Google
        Groups "Autobahn" group.
        To unsubscribe from this group and stop receiving emails from
        it, send
        an email to autobahnws+unsubscribe@__googlegroups.com
        <mailto:autobahnws%2...@googlegroups.com>
        <mailto:autobahnws+_...@googlegroups.com
        <mailto:autobahnws%2...@googlegroups.com>>.
        For more options, visit https://groups.google.com/d/__optout
        <https://groups.google.com/d/optout>.

    --
    You received this message because you are subscribed to the Google
    Groups "Autobahn" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to autobahnws+unsubscribe@__googlegroups.com
    <mailto:autobahnws%2...@googlegroups.com>.
    For more options, visit https://groups.google.com/d/__optout
    <https://groups.google.com/d/optout>.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

0 Likes