Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

New-SSHSession -OperationTimeout and -ConnectionTimeout

Open dbrennand opened this issue 4 years ago • 8 comments

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?

dbrennand avatar Apr 15 '20 15:04 dbrennand

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.

darkoperator avatar Apr 15 '20 19:04 darkoperator

Hmmm, it doesn't seem to be waiting the time I specify. 🤔

dbrennand avatar Apr 16 '20 07:04 dbrennand

In the code you linked, I cannot see where the -OperationTimeout parameter is used.

dbrennand avatar Apr 16 '20 07:04 dbrennand

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 avatar Apr 16 '20 13:04 darkoperator

@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.

L-P-G avatar Jul 07 '21 20:07 L-P-G

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.

ckaminski avatar Feb 16 '22 18:02 ckaminski

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.

MVKozlov avatar Feb 16 '22 19:02 MVKozlov

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

dbrennand avatar Oct 06 '22 09:10 dbrennand