Skip to content

AutoReconnect goes into an endless loop #31

@pr4gmat1q

Description

@pr4gmat1q

Hey. Faced a problem. When a session fails, it often does not work through reconnection. The try_reconnect method goes into an infinite loop and always throws a BrokenPipeError exception: [Errno 32] Broken pipe

client = AMIClient(address=config.ami_host, port=config.ami_port,timeout=2)
AutoReconnect(ami_client=client,delay=1)
future = client.login(username=config.ami_user,secret=config.ami_pass)


client.add_event_listener(
"""
add listeners
"""
)

if future.response.is_error():
 raise Exception(str(future.response))

try:
    while True:
        time.sleep(5)
except (KeyboardInterrupt, SystemExit):
 client.logoff()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions