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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -