autobahn.py websocket automatic reconect?

#1

Hi!

I’d just discovered crossbar and wamp, it seems very cool and i tink i will use it a lot in my python projects.

I have benn testing the demos and the examples, and there is something i miss when working with a python frontend: the autobahn.js implementation keeps trying to reconnect after a connection lost. With python i have no idea how to acomplish the same thing.

Does someone have an example of this?

Thanks!

  • Dennis.
0 Likes

#2

Hi!

I'd just discovered crossbar and wamp, it seems very cool and i tink i
will use it a lot in my python projects.

Great! Please keep us updated on what you do / progress!

I have benn testing the demos and the examples, and there is something i
miss when working with a python frontend: the autobahn.js implementation
keeps trying to reconnect after a connection lost. With python i have no
idea how to acomplish the same thing.

Does someone have an example of this?

With Autobahn/Twisted, the "recommended" way of making clients automatically reconnect is by mixing in Twisted ReconnectingClientFactory:

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/echo_variants/client_reconnecting.py

http://twistedmatrix.com/documents/current/api/twisted.internet.protocol.ReconnectingClientFactory.html

Hope this helps,
/Tobias

···

Am 20.06.2014 01:39, schrieb Dennis Xiloj:

Thanks!
- Dennis.

--
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!

I’d just discovered crossbar and wamp, it seems very cool and i tink i

will use it a lot in my python projects.

Great! Please keep us updated on what you do / progress!

Shure!

I have benn testing the demos and the examples, and there is something i

miss when working with a python frontend: the autobahn.js implementation

keeps trying to reconnect after a connection lost. With python i have no

idea how to acomplish the same thing.

Does someone have an example of this?

With Autobahn/Twisted, the “recommended” way of making clients
automatically reconnect is by mixing in Twisted ReconnectingClientFactory:

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/echo_variants/client_reconnecting.py

http://twistedmatrix.com/documents/current/api/twisted.internet.protocol.ReconnectingClientFactory.html

Hope this helps,

/Tobias

So with WAMP it should be like this… right?

https://gist.github.com/DenJohX/e6d0864738da10cb9685

Thanks for your help!

-Dennis

···

El viernes, 20 de junio de 2014 07:58:49 UTC-6, Tobias Oberstein escribió:

Am 20.06.2014 01:39, schrieb Dennis Xiloj:

0 Likes

#4

So with WAMP it should be like this... right?
https://gist.github.com/DenJohX/e6d0864738da10cb9685

Yep, that's the idea.

/Tobias

0 Likes

#5

Does this still work with Autobahn 0.9.x? I am trying to do something similar to this but my clientConnection{Lost,Failed} never get called.

I can provide code if needed.

Thanks,

Mike

···

On Saturday, June 21, 2014 3:04:55 PM UTC-4, Tobias Oberstein wrote:

So with WAMP it should be like this… right?

https://gist.github.com/DenJohX/e6d0864738da10cb9685

Yep, that’s the idea.

/Tobias

0 Likes

#6

Ok, got it working… I was using the wrong connect method. I tried being smart and thought reproducing what was in ApplicationRunner would work…

Thanks,

Mike

···

On Monday, September 22, 2014 8:38:07 PM UTC-4, Mike Panetta wrote:

On Saturday, June 21, 2014 3:04:55 PM UTC-4, Tobias Oberstein wrote:

So with WAMP it should be like this… right?

https://gist.github.com/DenJohX/e6d0864738da10cb9685

Yep, that’s the idea.

/Tobias

Does this still work with Autobahn 0.9.x? I am trying to do something similar to this but my clientConnection{Lost,Failed} never get called.

I can provide code if needed.

Thanks,

Mike

0 Likes

#7

     > So with WAMP it should be like this... right?
     > https://gist.github.com/DenJohX/e6d0864738da10cb9685
    <https://gist.github.com/DenJohX/e6d0864738da10cb9685>

    Yep, that's the idea.

    /Tobias

Does this still work with Autobahn 0.9.x? I am trying to do something
similar to this but my clientConnection{Lost,Failed} never get called.

Hi Mike,

I've added a complete example (works for me):

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/reconnecting

Cheers,
/Tobias

···

Am 23.09.2014 02:38, schrieb Mike Panetta:

On Saturday, June 21, 2014 3:04:55 PM UTC-4, Tobias Oberstein wrote:

I can provide code if needed.

Thanks,
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>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/04090f13-4172-4b85-a6ba-66d665273748%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/04090f13-4172-4b85-a6ba-66d665273748%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes