EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Send a recive Data SSH client

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#7016
Posted: 07/22/2008 04:32:53
by Josep Cristobal (Standard support level)
Joined: 07/22/2008
Posts: 1

Hello
I’m building a program (windows ce.net 5.0) with Visual Studio 2008 (VB.net).
I’m developing an emulator to access to an application resident in Linux, via SSh.
After I’m logging in the program, I send data and then the application responses With “ok “ or “no read” and “read 1 to 30”.
The major data to send is generate with reading the barcode on the laser reader.
When I send Data slowly (1 string/2 seconds) it responses very well . I send data and it responses ok or no ok,
But if I read and send data very quickly the application in the pda is blocked.
I believe that when I’m sending data I’m still receiving data and this causes a blockade.
How can I verify that I have received all the data to be able to send following string and to avoid the blockade.
The code used in the project is the same that you use in the SophisticatedSSHClient example.
In the clientSocket_OnReceive I recibe portions of data, but how can I know if I have received all the data?
Can you help me?
#7018
Posted: 07/22/2008 09:28:17
by Ken Ivanov (EldoS Corp.)

Quote
How can I verify that I have received all the data to be able to send following string and to avoid the blockade.

You need to perform a kind of locking to prevent calling public methods of TElSSHClient and related classes (e.g., TElSSHTunnelConnection) from several threads simultaneously.

Quote
In the clientSocket_OnReceive I recibe portions of data, but how can I know if I have received all the data?

It depends on the application-layer protocol you are using, as SSH does not care about the data being transferred (and thus does not know if the whole message has been sent). So you should detect the end of the data yourself.

BTW, you can use TElSimpleSSHClient class to bypass threading problems. TElSimpleSSHClient is synchronous and much easier to use than lower-level SSH classes.

Reply

Statistics

Topic viewed 1103 times

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




|

Back to top

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

Got it!