Not blocking after disconnect (General questions)
Email
Anonymous
Not blocking after disconnect 21-07-2006 02:15
Hi,
I have a problem where i connect to a telnet host (this works fine), i then disconnect the component and attempt to reconnect (this fails).
I have traced the problem to the WodSSH component behaving differently after the disconnect1 method is called (i use delphi).
It looks like after the discconect1 method is called, the blocking property is only half used. eg. I can call the WaitFor method but it always fails, this is because the recieve events are still being fired and data is being captured by them. I have put the example code below. Does anyone have any suggestions?
FTelnet := TwodSSHCom.Create( nil );
// hook up the events
FTelnet.OnReceived := wodSSHCom1Received;
FTelnet.OnDisconnected := wodSSHCom1Disconnected;
FTelnet.KeepAlives := 0;
FTelnet.Timeout := 0;
FTelnet.Blocking := true;
FTelnet.StripANSI := true;
FTelnet.Protocol := Telnet;
FTelnet.Connect1( '192.168.86.1' , 23 );
Data := FTelnet.WaitFor( 'login:' , 15 );
FTelnet.Send( 'myLogon' + #13#10 );
Data := FTelnet.WaitFor( 'Password:' , 15 );
FTelnet.Send( 'myPassword' + #13#10);
Data := FTelnet.WaitFor( 'OK' , 15 );
//everything works up until this point
FTelnet.Disconnect1(15);
// reconnect back to server. This works ok.
FTelnet.Connect1( '192.168.86.1' , 23 );
//wait for login prompt. This waitFor fails after the timeout but the onReceive event is fired multiple times with the correct login prompt in data. Looks like blocking is not working properly, even if i reset it.
Data := FTelnet.WaitFor( 'login:' , 15 );
Re: Not blocking after disconnect
Ryan,
hmm, yes, this makes sense, I have to try it out.
As a quick workaround, can I suggest you take new instance of wodSFTP for next connection? I assume it's just new call to Create method, ins't it? And previous on will be destroyed when your environment (Delphi) decides to do so..
Kreso
Re: Not blocking after disconnect
Hi,
Yep. I can probably look at recreating the instance (which will probably work). It is just that this is a legacy application that used to work with a previous telnet component from a different supplier and i was hoping to just insert the wodTelnet component without having to change too much code.
Is there a chance of getting this fixed?
Thanks.
Ryan.
Re: Not blocking after disconnect
Ryan,
of course it will be fixed. I'll ask our techsupport to duplicate it and it will be fixed asap.
You can help if you wish sending us your code so we can run it here and duplicate the problem.
Kreso
Re: Not blocking after disconnect
Hi Ryan,
You problem should be fixed.
Please download latest version of wodSSH Active component.
You can download new trial version here:
http://www.weonlydo.com/Samples/wodSSH.exe
If you are register user that you can download latest version here:
http://www.weonlydo.com/index.asp?update=1
This is automated process. Make sure you use same email address that is registered with our system, one you used when you have purchased the product.
Regards,
Drazen