EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SimpleSSHClient sometimes failed to send and freezing after that

Posted: 09/23/2009 21:05:07
by johnny  (Standard support level)
Joined: 08/20/2009
Posts: 19

Hi, I am using SimpleSSHClient for a very simple purpose: Just send one line command to my ssh server each time I clicked the button.

client.SendText("/etc/application/testing.sh" + vbCr)

It works fine for a while If I keep on clicking the button, and somehow just stopped working, it won't send anything to the server anymore, and there is no error fired through client.onerror.

What could be the possible cause?

Is that a way to check whether SSHClient has successfully sent the command?
Posted: 09/23/2009 23:45:43
by Eugene Mayevski (Team)

Looks like the component just times out trying to send the data
Check the value of SocketTimeout property. If it's 0, set it to 30000 (30 seconds). After this SendText should throw an exception instead of just blocking.

Sincerely yours
Eugene Mayevski
Posted: 09/24/2009 04:35:58
by johnny  (Standard support level)
Joined: 08/20/2009
Posts: 19

Thanks for your reply Eugene,

I have changed the sockettimeout to 30000 and tested with a simple for loop:
For i As Integer = 0 To 300
client.SendText("/etc/sshtest.sh" + vbCr)

I wrote a simple bash file in sshtest.sh to indicate whether sendtext is working properly:
#!/bin/bash -vx
echo 111111111 >> /etc/log

In the end the program seems only send command around 230 times and stopped.

There is no error fired as well after waiting for a long time:

Private Sub client_OnError(ByVal Sender As Object, ByVal ErrorCode As Integer) Handles client.OnError
' Timer.Enabled = False
MessageBox.Show("SSH Error:" + ErrorCode.ToString)
End Sub

any ideas?

Will it make a difference if I use client.senddata instead of sendtext?
Posted: 09/24/2009 05:23:50
by Eugene Mayevski (Team)

Do you mean that SendText just locks (and never returns) on attempt 231?

Changing SendText to SendData won't change anything significant. I'll move your request to HelpDesk for deeper investigation.

Sincerely yours
Eugene Mayevski



Topic viewed 992 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!