No way to detect dead AMI connection
See original GitHub issueI have been dealing with an AMI connection that timeout a lot and can therefore happen to be in a reconnecting state when it is contacted. This is giving me all sorts of fun issues to deal with.
When an action is send to AsterNET while the socket is reconnecting or lost, it throws a SystemException
(ManagerConnection.cs#L2029) which really threw me for a loop at first.
The only way to detect if the connection is reconnecting or if the socket has truly been lost (failed to reconnect ReconnectRetryMax
number of times), is by subscribing to the ConnectionState
event and checking the Reconnect
property of the DisconnectEvent
(ManagerConnection.cs#L1906).
I would very much like a way to see if AsterNET has failed to reconnect in another way too. Maybe IsConnected
(ManagerConnection.cs#L1955) should be changed to return true if it is currently attempting to reconnect even if the socket isn’t connected, a separate property could be used to check the socket state.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9
Top GitHub Comments
When you consider to remove the
IsConnected
property, maybe replace it with an ConnectionState property that returns an enumeration value to indicate it’s state (closed, connecting, open) similar toSqlConnection.State
property?As a long time user in the lib this issue his the number one problem maker in hour system , if any help on testing needed let us know , Many thanks in advanced Shlomi Gutman