Get() with bad URL and Blocking = true doesn't wo - WeOnlyDo Discussion board

Get() with bad URL and Blocking = true doesn't wo (General questions)

by Anca, Saturday, August 09, 2008, 15:20 (5949 days ago)

Hi,

I'm using wodHttpDLX.dll in VC++ 6.0, in blocking mode (Blocking = true).

If I do a Get method with a bad URL (for example adsd.adadas.das ) the program doesn't return after the Get() method. It remains in a blocked state... The Done event is launched (with ErrorCode != 0), the Disconnected too, but that's it... You can test this with your own SampleGet program sample, setting the Blocking to true and put some debug message before and after Get() method and in the events.

Do you have a response for that? Or a workaround?

Thanx,
Anca.

Re: Get() with bad URL and Blocking = true doesn

by wodDamir, Saturday, August 09, 2008, 20:07 (5949 days ago) @ Anca

Hi Anca,

What exactly do you mean by remains in blocked state?

When I edit the sample and do the following:

[code]m_Http.SetBlocking(TRUE);[/code]

Then I run the sample, and set hostname to a non-existent and click Get, the component throws an exception with Host not found. description.

Isn't that the case on your side?

I did the testing with the latest version, and the above line of code is the only thing i changed in the sample.

Regards,
Damba

Re: Get() with bad URL and Blocking = true doesn

by Anca, Sunday, August 10, 2008, 10:05 (5949 days ago) @ wodDamir

Yes, in your sample throws an exception but does not return after the line with Get() method. Should do that, because Blocking = true means that! I have the Error ( host not found ) in the ErrorText of the Done method, and I NEED to return after the Get() method, because I do something more with this result.

In my code it does not throw the exception either... Perhaps that will not help me anyway.

Put some debug messages in the event handlers to see what happend in case of normal URL and in case of bad URL. Maybe this can help you to find something...

Re: Get() with bad URL and Blocking = true doesn

by Anca, Sunday, August 10, 2008, 10:26 (5949 days ago) @ Anca

Ok, I did more testing, I tried to catch that exception in my code, and it worked! :)

From my point of view, the problem is solved... even if I consider this a workaround. If, for a future version of the component, you could do such a job (to return after the Get() in case of 'host not found' when Blocking = true), it would be great!

Thanx for response,
Anca.

Re: Get() with bad URL and Blocking = true doesn

by wodDamir, Sunday, August 10, 2008, 14:12 (5948 days ago) @ Anca

Anca,

When using Blocking mode, the code is terminated after the exception is thrown, and it doesn't proceed further.

You really need to catch that exception in order to let the code proceed.

Regards,
Damba