Frugghi / SwiftSH

A Swift SSH framework that wraps libssh2.
MIT License
194 stars 71 forks source link

Fixes Incorrect Socket Timeout #28

Open bakertim opened 5 years ago

bakertim commented 5 years ago

self.timeout is already converted to seconds so the extra /1000 changes the default 10 second timeout to 0.01 seconds. That's long enough that 1 out of every 3 or 4 attempts will connect correctly but the rest fail with the output:

DEBUG: Timeout set to 10.0 seconds
INFO: Libssh2 v1.8.0
DEBUG: <URL> resolved. 1 addresses
WARN: Connection to <IP_ADDRESS> on port 22 failed
INFO: Bye bye
DEBUG: Disconnected

This should resolve https://github.com/Frugghi/SwiftSH/issues/24.

jandolina commented 4 years ago

This fixed my issues! Thank you.

nmingotti commented 4 years ago

I confirm, removing / 1000 is fundamental or running a ssh comman will rarely work. I installed via pod a few days ago, the bug is still there. The easiest is to correct it straight in XCode, for now.