my python client disconnects and does not reconnect.

#1

Hi,

I implemented a tiny python application, which just subscribes to a channel and prints the received result.
However after a few minutes the application receives a close and a leave event and reacts no more to further messages.

the close callback is called with False
and then leave is called.

It seems, that an autobahnjs client automatically reconnects but a python autobahn client doesn’t

Is this normal behavior?
How to change my code such, that it reconnects automatically whenever a connection is lost.

I tried with twisted and asyncio and have exactly the same behavior is the same:

0 Likes

#2

Hi Gelonida!

Autobahn>Python doesn’t yet have the auto reconnect - see these issues

https://github.com/tavendo/AutobahnPython/issues/295

https://github.com/tavendo/AutobahnPython/issues/389

AFAIK this is currently being worked on - possibly we’ll see something working in the coming weeks.

Regards,

Alex

···

Am Donnerstag, 25. Juni 2015 20:27:41 UTC+2 schrieb Gelonida Gel:

Hi,

I implemented a tiny python application, which just subscribes to a channel and prints the received result.
However after a few minutes the application receives a close and a leave event and reacts no more to further messages.

the close callback is called with False
and then leave is called.

It seems, that an autobahnjs client automatically reconnects but a python autobahn client doesn’t

Is this normal behavior?
How to change my code such, that it reconnects automatically whenever a connection is lost.

I tried with twisted and asyncio and have exactly the same behavior is the same:

0 Likes

#3

Hi Alex,

Thanks a lot for your answer.

Hi Gelonida!

Autobahn>Python doesn’t yet have the auto reconnect - see these issues

https://github.com/tavendo/AutobahnPython/issues/295

https://github.com/tavendo/AutobahnPython/issues/389

AFAIK this is currently being worked on - possibly we’ll see something working in the coming weeks.

Could you explain in a few sentences how to reconnect in case of a leave event (which I seem to receive reliably whenever the connection is lost)?

The brute force approach, that should work without any knowlege of AutobahnPython would be to restart the entire process whenever the ‘leave’ event is encountered

But qhat would I have to do in AutobahnPython to restart a connection without having to restart the entire process.

Thanks a lot in advance for any suggestions.

···

On Friday, June 26, 2015 at 2:32:56 PM UTC+2, Alexander Gödde wrote:

Am Donnerstag, 25. Juni 2015 20:27:41 UTC+2 schrieb Gelonida Gel:

Hi,

I implemented a tiny python application, which just subscribes to a channel and prints the received result.
However after a few minutes the application receives a close and a leave event and reacts no more to further messages.

the close callback is called with False
and then leave is called.

It seems, that an autobahnjs client automatically reconnects but a python autobahn client doesn’t

Is this normal behavior?
How to change my code such, that it reconnects automatically whenever a connection is lost.

I tried with twisted and asyncio and have exactly the same behavior is the same:

0 Likes

#4

Hi Gelonida,

there are 2 aspects:

a) given the connection is lost, automatically reconnect. we are adding this feature to AutobahnPython under the tickets Alex mentioned
b) keeping connection from being lost: could you add the auto_ping_* options from here http://crossbar.io/docs/WebSocket-Options/#production-settings to your Crossbar.io configuration and see if that helps?

The latter should keep the connection from being closed by network intermediaries or endpoint gear.

Cheers,
/Tobias

···

Am Donnerstag, 25. Juni 2015 20:27:41 UTC+2 schrieb Gelonida Gel:

Hi,

I implemented a tiny python application, which just subscribes to a channel and prints the received result.
However after a few minutes the application receives a close and a leave event and reacts no more to further messages.

the close callback is called with False
and then leave is called.

It seems, that an autobahnjs client automatically reconnects but a python autobahn client doesn’t

Is this normal behavior?
How to change my code such, that it reconnects automatically whenever a connection is lost.

I tried with twisted and asyncio and have exactly the same behavior is the same:

0 Likes