SSHClient and SSHCustomChannel
Posted: Thu 30 Sep 2021 01:39
Hello,
We are working in Delphi 2007.
We need to add an SSHClient to our application. We currently have connections to TCP/IP servers, FTP servers and Telnet Servers. We create all classes at runtime. Do you have an example on how we can create these classes at runtime.
We want to use the SSHCustomChannel because we need to be notified when data is received from the server. We want to add the TScAsyncReceiveEvent = procedure(Sender: TObject) of object; to the class. See below.
Also, we are using atPassword for the Authentication. Do we need to add TScFileStorage for password authentication.
Our application can connect to a number of servers. We added the devicenum and portnum fields to the class so we can tell when data is received in the socket1OnAsyncReceive what device it is associated with. Will this be included in the Sender:Tobject.
tsshsocket=class(TScSSHCustomChannel)
public
devicenum:integer;
portnum:integer;
procedure socket1OnAsyncError(Sender: TObject; E: Exception)
procedure socket1OnAsyncReceive(Sender: TObject);
procedure socket1OnConnect;
procedure socket1disconnect;
end;
tsshcclient=class(TScSSHClient)
public
devicenum:integer;
portnum:integer;
end;
Thanks for all your help.
We are working in Delphi 2007.
We need to add an SSHClient to our application. We currently have connections to TCP/IP servers, FTP servers and Telnet Servers. We create all classes at runtime. Do you have an example on how we can create these classes at runtime.
We want to use the SSHCustomChannel because we need to be notified when data is received from the server. We want to add the TScAsyncReceiveEvent = procedure(Sender: TObject) of object; to the class. See below.
Also, we are using atPassword for the Authentication. Do we need to add TScFileStorage for password authentication.
Our application can connect to a number of servers. We added the devicenum and portnum fields to the class so we can tell when data is received in the socket1OnAsyncReceive what device it is associated with. Will this be included in the Sender:Tobject.
tsshsocket=class(TScSSHCustomChannel)
public
devicenum:integer;
portnum:integer;
procedure socket1OnAsyncError(Sender: TObject; E: Exception)
procedure socket1OnAsyncReceive(Sender: TObject);
procedure socket1OnConnect;
procedure socket1disconnect;
end;
tsshcclient=class(TScSSHClient)
public
devicenum:integer;
portnum:integer;
end;
Thanks for all your help.