From: Piotr Starczewski on 19 Dec 2006 10:43 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 19 Dec 2006 10:48 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 19 Dec 2006 10:48 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 19 Dec 2006 11:12 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 19 Dec 2006 11:16 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
|
Next
|
Last
Pages: 1 2 Prev: ANN: wxPdfDocument 0.8.0 released Next: Link and build problems when using 2.8.0 |