Options Structure/Class

[C]

struct FlowSshC_Options
{
  bool m_startKeyReExchange;
  int m_sendBasedKeepAliveTimeoutMs;
  int m_recvBasedKeepAliveTimeoutMs;
  int m_recvBasedKeepAliveRelaxedTimeoutMs;
  int m_recvBasedUnresponsivenessTimeoutMs;
};

[C++]

struct Options : public FlowSshC_Options
{
  Options()
  {
    m_startKeyReExchange = true;
    m_sendBasedKeepAliveTimeoutMs = -1;
    m_recvBasedKeepAliveTimeoutMs = -1;
    m_recvBasedKeepAliveRelaxedTimeoutMs = -1;
    m_recvBasedUnresponsivenessTimeoutMs = -1;
  }
};

[C#]

public sealed class Options
{
  bool StartKeyReExchange;
  int SendBasedKeepAliveTimeoutMs;
  int RecvBasedKeepAliveTimeoutMs;
  int RecvBasedKeepAliveRelaxedTimeoutMs;
  int RecvBasedUnresponsivenessTimeoutMs;
  
  public Options()
  {
    StartKeyReExchange = true;
    SendBasedKeepAliveTimeoutMs = -1;
    RecvBasedKeepAliveTimeoutMs = -1;
    RecvBasedKeepAliveRelaxedTimeoutMs = -1;
    RecvBasedUnresponsivenessTimeoutMs = -1;
  }
}

Members

  • StartKeyReExchange: Whether FlowSsh should start key re-exchange. Enabled by default.

  • SendBasedKeepAliveTimeoutMs: Use 0 to disable send-based keep-alive, -1 to use the default value in FlowSsh, or specify your own value in milliseconds. At the time of this writing, the default value is 30 seconds.

  • RecvBasedKeepAliveTimeoutMs: Use 0 to disable receive-based keep-alive, -1 to use the default value in FlowSsh, or specify your own value in milliseconds. At the time of this writing, the default value is 20 seconds.

  • RecvBasedKeepAliveRelaxedTimeoutMs: Use -1 to use the default value in FlowSsh, or specify your own value in milliseconds. This value is used instead of the usual timeout at initial stages of the connection, before authentication is successful. At the time of this writing, the default value is 90 seconds.

  • RecvBasedUnresponsivenessTimeoutMs: Use 0 to disable receive-based unresponsiveness timeout, -1 to use the default value in FlowSsh, or specify your own value in milliseconds. This value will take effect only after the initial keep-alive timeout has triggered. At the time of this writing, the default value is 20 seconds.

Remarks

Key re-exchange and keep-alive are enabled by default, and do not need to be enabled explicitly by calling SetOptions.

If starting of key re-exchange is enabled, FlowSsh will start it every hour, or after every 1 GB of transferred data. If starting of key re-exchange is disabled, FlowSsh will still respond to key re-exchanges started by the server.

FlowSsh uses sensible values of keep-alive parameters by default. You should only need to change these values if you are solving an unexpected problem. If you are solving an unexpected problem, then the nature of that problem can guide what values to use.

Send-based keep-alive is a mechanism where FlowSsh will periodically send a packet of type SSH_MSG_IGNORE if it has not sent any SSH packets for a duration of time exceeding the send-based keep-alive timeout. This works with all remote SSH software, but does not reliably detect all types of broken network connections.

Receive-based keep-alive is a mechanism where FlowSsh will periodically send a packet of type SSH_MSG_GLOBAL_REQUEST if it has not received any SSH packets for a duration of time exceeding the receive-based keep-alive timeout. If the remote SSH software does not respond within the unresponsiveness timeout, FlowSsh terminates the connection. This reliably detects broken network connections, but it can have false positives if the remote party stalls processing for long periods of time. For example, some servers stall when executing a command or handling the initial login.

The relaxed receive-based keep-alive timeout is used during initial stages of the SSH session, before authentication has succeeded. This accommodates servers that may need a long time to process a user authentication request and do not respond during.

There exist rare servers which cannot handle a packet of type SSH_MSG_GLOBAL_REQUEST from a client. FlowSsh will disable receive-based keep-alive when the SSH version string suggests the server may not properly handle global requests.