Posh-SSH
Posh-SSH copied to clipboard
New-SSHSession -OperationTimeout and -ConnectionTimeout
Hi,
For the New-SSHSession
function. It isn't documented if OperationTimeout
or ConnectionTimeout
are in seconds or milliseconds.
Without the function it errors saying the host didn't respond in 10000
milliseconds. However, I just wanted to ask to confirm that it's milliseconds?
@darkoperator
EDIT: It looks like the function isn't respecting what I pass to it? For example, I set the int value to 20000 for both and it still fails after around 15 seconds 😆 So it could be milliseconds?
Seconds https://github.com/darkoperator/Posh-SSH/blob/master/Source/PoshSSH/PoshSSH/NewSessionBase.cs#L139 https://github.com/darkoperator/Posh-SSH/blob/master/Source/PoshSSH/PoshSSH/NewSessionBase.cs#L139 need to figure out why the help info is not shown
On Apr 15, 2020, at 11:38 AM, dbrennand [email protected] wrote:
Hi,
For the New-SSHSession function. It isn't documented if OperationTimeout or ConnectionTimeout are in seconds or milliseconds. Without the function it errors saying the host didn't respond in 10000 milliseconds. However, I just wanted to ask to confirm that it's milliseconds? @darkoperator https://github.com/darkoperator — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/darkoperator/Posh-SSH/issues/323, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7IHVTZ3KO7MRSW2A5DQDRMXIF7ANCNFSM4MIVWJAQ.
Hmmm, it doesn't seem to be waiting the time I specify. 🤔
In the code you linked, I cannot see where the -OperationTimeout parameter is used.
You are correct, will remove operation timeout. The connection info object does not have a property to set it, seems it is a copy paste mistake from another cmdlet.
@darkoperator is connection timeout also affected by this? I'm seeing Set-SCPFile failing to error out when using connection or operationtimeout. I can open a new issue if need be.
Is it just me, or in NewSessionBase.cs is OperationTimeout not getting set?
See roughly line 344 where the connection timeout is set.. I see no usage of operation timeout on the scpclient object (since it's not a property on the baseclient?)
I assume the other clients in the switch on line 253 suffer the same?
The default is 5, if I try to use get-scpfile with operationtimeout set to 300, the operation exits in 5 seconds, which is expected if the timeout is never actually used.
take a quick look at the sources, seems OperationTimeout
is not used anywhere.
if it can be supported by some clients, it should be moved to the appropriate cmdlets.
Is it just me, or in NewSessionBase.cs is OperationTimeout not getting set?
See roughly line 344 where the connection timeout is set.. I see no usage of operation timeout on the scpclient object (since it's not a property on the baseclient?)
I assume the other clients in the switch on line 253 suffer the same?
The default is 5, if I try to use get-scpfile with operationtimeout set to 300, the operation exits in 5 seconds, which is expected if the timeout is never actually used.
take a quick look at the sources, seems
OperationTimeout
is not used anywhere. if it can be supported by some clients, it should be moved to the appropriate cmdlets.
Hi both, yes as I said in https://github.com/darkoperator/Posh-SSH/issues/323#issuecomment-614475604, at that time OperationTimeout
was not available however, I think it might do now?: https://github.com/darkoperator/Posh-SSH/blob/master/Source/PoshSSH/PoshSSH/NewSessionBase.cs#L121