on_reconnect_attempt Event
Fires when attempting to reconnect.
Syntax
class SSHReverseTunnelReconnectAttemptEventParams(object): @property def host() -> str: ... @property def port() -> int: ... @property def retry_count() -> int: ... @property def retries_remaining() -> int: ... @property def max_retry_count() -> int: ... @property def retry_interval() -> int: ... @property def retry_type() -> int: ... @property def remote_listening_port() -> int: ... @property def cancel() -> bool: ... @cancel.setter def cancel(value) -> None: ... # In class SSHReverseTunnel: @property def on_reconnect_attempt() -> Callable[[SSHReverseTunnelReconnectAttemptEventParams], None]: ... @on_reconnect_attempt.setter def on_reconnect_attempt(event_hook: Callable[[SSHReverseTunnelReconnectAttemptEventParams], None]) -> None: ...
Remarks
This event fires when attempting to reconnect to the ssh_host or when re-establishing a SSH tunnel.
This is only applicable when AutoReconnect is set to True. This event may fire both when establishing the SSH connection, and when establishing the SSH tunnel over the SSH connection. To determine which type of connection is being established check the RetryType parameter.
The following table provides details about the parameters.
Host | Hold the SSH host to which the connection is attempted. |
Port | Is the Port on the SSH host to which the connection is attempted. |
RetryCount | Indicates the current retry attempt. For instance this may be retry 2 of 5, then RetryCount will hold the value 2. |
RetriesRemaining | The number of retries remaining after this attempt. This number does not include the current attempt. If MaxRetryCount is set to unlimited this will return -1. |
MaxRetryCount | The maximum number of retries as specified in MaxRetryCount. |
RetryInterval | The interval (in seconds) between retry attempts as specified in RetryInterval. |
RetryType | The type of connection being retried. Possible values are:
|
RemoteListeningPort | The port on the SSH host which the reverse tunnel will use. This is only applicable when RetryType is 1 (Reverse Tunnel). |
Cancel | May be set within this event to cancel the retry attempts. If set to True no further retry attempts will be executed. |