Stop() behaviour & Access Violation - WeOnlyDo Discussion board

Stop() behaviour & Access Violation (wodSSHServer)

by David Lucas, Wednesday, January 04, 2006, 16:16 (4337 days ago)

We are developing an application in C++ Builder 6 under Windows XP and we've recently encountered a problem when attempting to call TwodSSHDCom's Stop() method - the clients remain connected. You can even delete the TwodSSHDCom object without the client realising that the connection has gone. The client only realises the connection has been terminated when TwodSSHDCom's owning process is terminated.

While attempting to resolve this in a small test application we also noted an access violation that occurs when deleting TwodSSHDCom while clients are connected (this only seems to apply to SSH and doesn't occur if the client is not yet authenticated). We have updated to the latest version of TwodSSHDCom, but the results are the same.

Here is the code used to create TwodSSHDCom:

Server = new TwodSSHDCom((TComponent*)NULL);

WideString Filename = c:\mykey.rsa ;
if(FileExists(Filename))
{
Server->Keys->Load(Filename);
}
else
{
Server->Keys->Generate(RSAkey);
Server->Keys->Save(RSAkey, Filename);
}

Server->set_Port(5000);
// Event handler that just sets Accept to true.
Server->OnLoginPassword = ServerLoginPassword;

Server->Start();


And here is the code used to delete it:

Server->Stop();
delete Server;
Server = NULL;


Regards,

David Lucas
Data Track Technology


Complete thread: