python - Autobahn Asyncio ReconnectingClientFactory -
i make reconnectingclientfactory
asyncio. in particular handle case server not available when client started in case reconnectingclientfactory
keep trying. asyncio.events.create_connection
not do.
concretely:
the echoclient example fine. crux how connection made.
factory = echoclientfactory('ws://127.0.0.1:5678') connectws(factory)
in case of twisted version reconnectingclientfactory
.
vs
factory = echoclientfactory(u"ws://127.0.0.1:5678") factory.protocol = secureserverclientprotocol loop = asyncio.get_event_loop() # coro = loop.create_connection(factory, 'ws_server', 5678) coro = loop.create_connection(factory, '127.0.0.1', 5678) loop.run_until_complete(asyncio.wait([ alive(), coro ])) loop.run_forever() loop.close()
or similar asycnio version.
the problem in asyncio version connection established asyncio.events.create_connection
fails if server not available.
how can reconcile two?
many
Comments
Post a Comment