From: Piotr Starczewski on
Hello,

I have a problem with getting input stream from http site. I have
constructed wxURL, but it seams to hang on wxURL::GetInputStream(). Does
anyone else have such problem? If so is there any workaround for it?
Here is a sample code that I'm using:

wxURL url(__url);
if (url.IsOk())
{
wxInputStream* _in_stream;
_is_stream = url.GetInputStream(); // <-- Hangs here and
waits for something. :(
...
}


Using:
wx280 CVS
WinXP sp2
Code::Blocks
GCC

Regards,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: chris elliott on
how about ...

wxURL url(myURL);
if (url.GetError() != wxURL_NOERR)
{
return NULL ;
}
wxInputStream * pInput = url.GetInputStream() ;

what is the URL?

chris
Piotr Starczewski wrote:
> Hello,
>
> I have a problem with getting input stream from http site. I have
> constructed wxURL, but it seams to hang on wxURL::GetInputStream(). Does
> anyone else have such problem? If so is there any workaround for it?
> Here is a sample code that I'm using:
>
> wxURL url(__url);
> if (url.IsOk())
> {
> wxInputStream* _in_stream;
> _is_stream = url.GetInputStream(); // <-- Hangs here and
> waits for something. :(
> ...
> }
>
>
> Using:
> wx280 CVS
> WinXP sp2
> Code::Blocks
> GCC
>
> Regards,
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Francesco Montorsi on
Piotr Starczewski ha scritto:
> Hello,
>
> I have a problem with getting input stream from http site. I have
> constructed wxURL, but it seams to hang on wxURL::GetInputStream(). Does
> anyone else have such problem? If so is there any workaround for it?
> Here is a sample code that I'm using:
>
> wxURL url(__url);
> if (url.IsOk())
> {
> wxInputStream* _in_stream;
> _is_stream = url.GetInputStream(); // <-- Hangs here and
> waits for something. :(
> ...
> }
>
the problem is that the timeout for the connection with the server is
set by default to 10 minutes. Too long. It seems to be hanged but it's not.

You need to get access to the wxProtocol associated with the wxURL and
use SetTimeout with a reasonable value.

HTH,
Francesco


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Piotr Starczewski on
It doesn't make a difference because wxURL::IsOk() is defined as return
(GetError() == wxURL_NOERR). Also I have added else statement just to
see if there are no errors. If you want you can try this address:
http://redphoenix.sytes.net/test/test.txt

Peter

chris elliott wrote:
> how about ...
>
> wxURL url(myURL);
> if (url.GetError() != wxURL_NOERR)
> {
> return NULL ;
> }
> wxInputStream * pInput = url.GetInputStream() ;
>
> what is the URL?
>
> chris
> Piotr Starczewski wrote:
>> Hello,
>>
>> I have a problem with getting input stream from http site. I have
>> constructed wxURL, but it seams to hang on wxURL::GetInputStream().
>> Does anyone else have such problem? If so is there any workaround for
>> it?
>> Here is a sample code that I'm using:
>>
>> wxURL url(__url);
>> if (url.IsOk())
>> {
>> wxInputStream* _in_stream;
>> _is_stream = url.GetInputStream(); // <-- Hangs here and
>> waits for something. :(
>> ...
>> }
>>
>>
>> Using:
>> wx280 CVS
>> WinXP sp2
>> Code::Blocks
>> GCC
>>
>> Regards,
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
>> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org

From: Piotr Starczewski on
Thanks, I have setted it to 1 minute. The problem is that I CAN access
file with IE or FireFox, but I get time out with wxURL. Also another
thing is that I get empty string ("") with wxProtocol::GetContentType()
and error code: 45157104 with wxProtocol::GetError(). It doesn't help me
a bit with solving the problem. Any other ideas?

Regards,
Peter

Francesco Montorsi wrote:
> Piotr Starczewski ha scritto:
>> Hello,
>>
>> I have a problem with getting input stream from http site. I have
>> constructed wxURL, but it seams to hang on wxURL::GetInputStream().
>> Does anyone else have such problem? If so is there any workaround for
>> it?
>> Here is a sample code that I'm using:
>>
>> wxURL url(__url);
>> if (url.IsOk())
>> {
>> wxInputStream* _in_stream;
>> _is_stream = url.GetInputStream(); // <-- Hangs here and
>> waits for something. :(
>> ...
>> }
>>
> the problem is that the timeout for the connection with the server is
> set by default to 10 minutes. Too long. It seems to be hanged but it's
> not.
>
> You need to get access to the wxProtocol associated with the wxURL and
> use SetTimeout with a reasonable value.
>
> HTH,
> Francesco
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org