IPWorks SSH 2020 Kotlin Edition

Questions / Feedback?

ReconnectAttempt Event

Fires when attempting to reconnect.

Syntax

public open class DefaultSshreversetunnelEventListener : SshreversetunnelEventListener {
  ...
  public override fun reconnectAttempt(e: SshreversetunnelReconnectAttemptEvent) {}
  ...
}

public class SshreversetunnelReconnectAttemptEvent {
  val host: String?
  val port: Int
  val retryCount: Int
  val retriesRemaining: Int
  val maxRetryCount: Int
  val retryInterval: Int
  val retryType: Int
  val remoteListeningPort: Int
  var cancel: Boolean
}

Remarks

This event fires when attempting to reconnect to the SSHHost 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:
  • 0 - SSH
  • 1 - Reverse Tunnel
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.

Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks SSH 2020 Kotlin Edition - Version 20.0 [Build 7941]