KeepConnectoinAlive?
KeepConnectoinAlive?
Hello,
(1) I would like to have something like KeepConnectoinAlive in the SSHclient.
(2) If the SSH client is open in design, the program crash when i run it. Is that normal behavior? If SSH is closed it will not crash.
(3) Is it possible to abort the connection from the "before connect" event?
Regards, Pär
(1) I would like to have something like KeepConnectoinAlive in the SSHclient.
(2) If the SSH client is open in design, the program crash when i run it. Is that normal behavior? If SSH is closed it will not crash.
(3) Is it possible to abort the connection from the "before connect" event?
Regards, Pär
Re: KeepConnectoinAlive?
1. If you want us to add this functionality, please write about it at our User Voice forum: https://devart.uservoice.com/forums/174370-securebridge. If your suggestion gets enough votes, we will consider the possibility of its implementation.
2-3. If the program is written correctly, then when performing the specified actions, it should not crash. If a connection was established in design time, when running a program in runtime, it will attempt to install at startup. You can abort the connection attempt in the BeforeConnect event handler by generating Exception in it. This handler is executed when trying to connect, so please make sure that the correct values are set in it.
2-3. If the program is written correctly, then when performing the specified actions, it should not crash. If a connection was established in design time, when running a program in runtime, it will attempt to install at startup. You can abort the connection attempt in the BeforeConnect event handler by generating Exception in it. This handler is executed when trying to connect, so please make sure that the correct values are set in it.
Re: KeepConnectoinAlive?
Thanx, but how do i abort by generating an exception?
regards, Pär
regards, Pär
Re: KeepConnectoinAlive?
In order for us to give a more accurate and detailed answer, please specify the exact steps to reproduce it.
Re: KeepConnectoinAlive?
Step 1, read the line "In order for us to give a more accurate and detailed answer, please specify the exact steps to reproduce it."
Step 2, Read "You can abort the connection attempt in the BeforeConnect event handler by generating Exception in it. This handler is executed when trying to connect, so please make sure that the correct values are set in it."
Step 3, google, look in books you have and find out You don't know how to do that.
Step 4, Now problem reproduced!
Step 2, Read "You can abort the connection attempt in the BeforeConnect event handler by generating Exception in it. This handler is executed when trying to connect, so please make sure that the correct values are set in it."
Step 3, google, look in books you have and find out You don't know how to do that.
Step 4, Now problem reproduced!
Re: KeepConnectoinAlive?
To abort the connection attempt in the BeforeConnect event handler by generating Exception, you can use the following code:
Code: Select all
procedure TSSHClientFrame.ScSSHClientBeforeConnect(Sender: TObject);
begin
raise EScError.Create('Connection attempt was aborted');
end;
Re: KeepConnectoinAlive?
Hello,
The code You provided have two problems:
(1) It tell the user there is an error. I don't want that. I just want to silent not connect.
(2) When i later try to connect i get an error.
Regards, Pär
The code You provided have two problems:
(1) It tell the user there is an error. I don't want that. I just want to silent not connect.
(2) When i later try to connect i get an error.
Regards, Pär
Re: KeepConnectoinAlive?
Picture of error. I dont know why it dont work but here it is:
https://www.dropbox.com/s/d3rutshgkhwv9 ... t.jpg?dl=0
https://www.dropbox.com/s/d3rutshgkhwv9 ... t.jpg?dl=0
Re: KeepConnectoinAlive?
1. To solve your issue you can, for example use the following guidelines:
a)
b)
2. In order for us to be able to give you a detailed answer please compose a full sample demonstrating the described behavior and send it to us.
a)
Code: Select all
procedure TSSHClientFrame.ScSSHClientBeforeConnect(Sender: TObject);
begin
raise EScError.Create('Connection attempt was aborted');
end;
...
try
ScSSHClient.Connect;
except
on E: Exception do
if E.Message <> 'Connection attempt was aborted' then
raise;
end;
Code: Select all
procedure TSSHClientFrame.ScSSHClientBeforeConnect(Sender: TObject);
begin
Abort;
end;
Re: KeepConnectoinAlive?
Where do I click to upload a file? nm, i paste the url.
https://www.dropbox.com/s/jptgvmstgszij ... t.rar?dl=0
Step to reproduce:
(1) Enter correct port, userid, password etc for ssh client and connection to your server.
(2) Set the client to connected in design (let it connect).
(3) Run.
If it can "silent" abort before connect and then later manually connect by click "connect" it works. But i get error when i try.
https://www.dropbox.com/s/jptgvmstgszij ... t.rar?dl=0
Step to reproduce:
(1) Enter correct port, userid, password etc for ssh client and connection to your server.
(2) Set the client to connected in design (let it connect).
(3) Run.
If it can "silent" abort before connect and then later manually connect by click "connect" it works. But i get error when i try.
Re: KeepConnectoinAlive?
This behavior is correct, since most components having properties like BeforeConnect behave this way. This behavior can be reproduced on the standard Delphi component (TClientDataSet).
The correct decision is not to set the Connected property in design time, but work with it in runtime.
The correct decision is not to set the Connected property in design time, but work with it in runtime.
Re: KeepConnectoinAlive?
I'm trying to fins a way so it dosen''t matter i i forget. As some as i do some changes in design, the connection turns open. I have to manually turn off connection 20 times every day when i work with it. But if not possible then its not possible.
Re: KeepConnectoinAlive?
Thank you for the interest to our product.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.