0 votes
by (120 points)
edited

Ssh client = new Ssh(); client.Timeout = 1; client.Connect("192.168.1.10",22);

I expected this to timeout after 1 second, but it timed out after 5 seconds.

What is the problem?

by (147k points)
edited

The Timeout value doesn't apply to the whole method (Connect or other), but to its separate sub-operations (connect, exchange welcome messages, negotiate SSH session). To be able to tell what is going on and why we didn't time out earlier, a communication log would be needed - check out http://www.rebex.net/kb/logging.aspx for how to create one and either add it to your post or mail it to support@rebex.net

1 Answer

0 votes
by (147k points)
edited

Also, please note that the Timeout value is specified in miliseconds, which means it should be set to 1000 to specify 1 second. However, 1000 is the lowest allowed value - if you set it to 1-999, it defaults to 1000 (1 second).

...