When the server closes a connection with a NotPermittedException, use the
REPLACED transition rather than the STOPPED transition. This is because the
REPLACED transition is used for the server having closed the connection, where
as STOPPED assumes the client has sent a stop and waits for a response from
the server (which in this case we're not going to get).
Update the FSM to allow a "fatal" response to an open (i.e. server rejects the
client because it is not authorized) when the client is in retrying state. This
is an omission in the original design of the FSM - as we only considered
handling this kind of failure when the client first connects, not when it has
already been connected and is in retrying state.
This fixes the following exception:
java.lang.IllegalStateException: No valid leaving transitions are permitted from
state 'Retrying2B' for trigger 'OPEN_RESP_FATAL'. Consider ignoring the trigger.
When the server closes a connection with a NotPermittedException, use the REPLACED transition rather than the STOPPED transition. This is because the REPLACED transition is used for the server having closed the connection, where as STOPPED assumes the client has sent a stop and waits for a response from the server (which in this case we're not going to get).
Update the FSM to allow a "fatal" response to an open (i.e. server rejects the client because it is not authorized) when the client is in retrying state. This is an omission in the original design of the FSM - as we only considered handling this kind of failure when the client first connects, not when it has already been connected and is in retrying state.
This fixes the following exception: