WaitFor not timing out - WeOnlyDo Discussion board

WaitFor not timing out (General questions)

by Ryan, Monday, May 24, 2010, 04:53 (5296 days ago)

Hi,
I am having trouble with the waitFor method not timing out.
I have a situation where when a lock is encountered on our database it sends out the bell character (char 7) every second in a loop until the lock is released.
I am using the waitFor method to search for a character and timeout if it does not find it withing 30 seconds, however if we encouter this locked condition the timeout never occurs and our program gets stuck in the waitFor method.
I assume what is happening, is that the waitFor method has a loop which continually calls receive ? In this case, receive will keep getting bells every second so no timeout happens. The char 7 is non ANSI so it probably also gets stripped, so we are stuck in waitFor until i manually release the lock.
Is there a workaround or fix for this problem?

Thanks,
Ryan.

Re: WaitFor not timing out

by wodDamir, Monday, May 24, 2010, 09:13 (5296 days ago) @ Ryan

Ryan,

Can you please show me your loop where you call the WaitFor method, and send out the bell char?

Also, you're Waiting for the same bell character or something else?

Regards,
Damba

Re: WaitFor not timing out

by Ryan, Tuesday, May 25, 2010, 01:48 (5295 days ago) @ wodDamir

Ryan,

Can you please show me your loop where you call the WaitFor method, and send out the bell char?

Also, you're Waiting for the same bell character or something else?

Regards,
Damba

Hi,
Unfortunately it is not my code which is in the loop sending the bell character, it is being sent from the database we use over telnet.

The code which i am calling waitFor is as follows:

//this line can cause an infinite block
returnedData := FTelnet.WaitFor( SearchData , FMainTimeout );

The problem is that this call blocks forever. I am waiting for a different character so i would expect a timeout, however the timeout never occurs and my program is therefore stuck forever. I believe this is because a problem exists in your waitFor method where it receives a constant stream of data such as bell characters.

Are you aware of this situation? I am not sure exactly how you have implemented the waitFor method, but it sounds as though it is just a loop of receives which relies upon the timeout of the receive method. If this is the case then a constant stream of data will cause an infinite loop as receive will always return something (but not the char i am waiting for). The waitFor will actually have to contain its own timer and raise an exception when it expires. Does it do this?

I can probably write my own waitFor method but i was hoping not to do this.
Please let me know if you need any further info.

Thanks,
Ryan.

Re: WaitFor not timing out

by woddrazen, Tuesday, May 25, 2010, 09:40 (5295 days ago) @ Ryan

Ryan,


Did you maybe try our samples in component Samples folder? Are you able to duplicate problem using our samples?

Is there any chance that we can connect there and duplicate this issue? We will just connect few times duplicate it and immediately disconnect.

Which version you are using? You can check version using wodSSH Version Property. Latest version is 2.9.1.138.

Sorry for all my questions but we have to isolate your problem somehow and try to resolve it.


Drazen

Re: WaitFor not timing out

by Ryan, Wednesday, May 26, 2010, 04:36 (5294 days ago) @ woddrazen

Ryan,


Did you maybe try our samples in component Samples folder? Are you able to duplicate problem using our samples?

Is there any chance that we can connect there and duplicate this issue? We will just connect few times duplicate it and immediately disconnect.

Which version you are using? You can check version using wodSSH Version Property. Latest version is 2.9.1.138.

Sorry for all my questions but we have to isolate your problem somehow and try to resolve it.


Drazen


Hi,
I have just tried the sample in the samples folder, and YES I am able to reproduce it with this example.

I am using version 2.7.2.106 which is a few revisions old, but i couldn't see anything in the release notes which resolved this problem in a newer version.

Unfortunately our telnet server is only available internally so i am unable to give you access for testing. However, the good news is that i was able to create a dummy application which simulates this problem.
I can email this example application through if you wish (what is your email address?).
The example is pretty straight for in that it just sends a continual stream of telnet data which causes your waitFor to never timeout.

Ryan.

Re: WaitFor not timing out

by Ryan, Wednesday, May 26, 2010, 06:09 (5294 days ago) @ Ryan

Ryan,


Did you maybe try our samples in component Samples folder? Are you able to duplicate problem using our samples?

Is there any chance that we can connect there and duplicate this issue? We will just connect few times duplicate it and immediately disconnect.

Which version you are using? You can check version using wodSSH Version Property. Latest version is 2.9.1.138.

Sorry for all my questions but we have to isolate your problem somehow and try to resolve it.


Drazen


Hi,
I have just tried the sample in the samples folder, and YES I am able to reproduce it with this example.

I am using version 2.7.2.106 which is a few revisions old, but i couldn't see anything in the release notes which resolved this problem in a newer version.

Unfortunately our telnet server is only available internally so i am unable to give you access for testing. However, the good news is that i was able to create a dummy application which simulates this problem.
I can email this example application through if you wish (what is your email address?).
The example is pretty straight for in that it just sends a continual stream of telnet data which causes your waitFor to never timeout.

Ryan.

Hi,
I have just sent an example to reproduce the problem to techsupport.
Hopefully this will allow you to identify the problem.

Thanks,
Ryan.