From: Troels on 19 Dec 2006 11:22 Francesco Montorsi wrote: > You need to get access to the wxProtocol associated with the wxURL and > use SetTimeout with a reasonable value. Or perhaps call SetFlags(wxSOCKET_NOWAIT)? (Bug #1612106) Regards
From: Piotr Starczewski on 19 Dec 2006 12:00 Using debugger I have found out that wxURL::m_error = wxURL_NOERR before I'm calling GetInputStream() and it's changing the state to wxURL_PROTOERR after GetInputStream(). What I don't understand is why do I get error on negotiation and how should I fix it? I'm doing everything as should be done according to manual. 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 20 Dec 2006 07:31 Hi again, I have managed to solve my problem. It seams that wxURL is working correctly only from the second thread. Now as soon as I move my code from second thread to main one it just seams to not be able to get correct stream. It's not a big problem to me, but I didn't know that wxURL requires separate thread to work correctly. Any ideas why? Regards, Peter Piotr Starczewski wrote: > Using debugger I have found out that wxURL::m_error = wxURL_NOERR > before I'm calling GetInputStream() and it's changing the state to > wxURL_PROTOERR after GetInputStream(). What I don't understand is why > do I get error on negotiation and how should I fix it? I'm doing > everything as should be done according to manual. > > 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 > > > --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
From: Frode Gill on 20 Dec 2006 07:48 On Wed, 20 Dec 2006 13:31:47 +0100, Piotr Starczewski <pstarczewski(a)o2.pl> wrote: > I have managed to solve my problem. It seams that wxURL is working > correctly only from the second thread. Now as soon as I move my code > from second thread to main one it just seams to not be able to get > correct stream. I experienced something similiar (socket streams and multithreading). Solved it by calling wxSocketBase::Initialize in wxApp::OnInit. I saw this documented somewhere, but maybe only as a comment in the source? -- Frode Gill
From: Piotr Starczewski on 20 Dec 2006 08:18 Thanks, but I know about that and it doesn't make any difference if I will initialize socket in wxApp or not. Main thread is still not able to use wxURL while secondary thread works fine. Regards, Peter Frode Gill wrote: > > On Wed, 20 Dec 2006 13:31:47 +0100, Piotr Starczewski > <pstarczewski(a)o2.pl> wrote: > >> I have managed to solve my problem. It seams that wxURL is working >> correctly only from the second thread. Now as soon as I move my code >> from second thread to main one it just seams to not be able to get >> correct stream. > > I experienced something similiar (socket streams and multithreading). > Solved it by calling wxSocketBase::Initialize in wxApp::OnInit. I saw > this documented somewhere, but maybe only as a comment in the source? > > --Frode Gill > > > > --------------------------------------------------------------------- > 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
First
|
Prev
|
Pages: 1 2 Prev: ANN: wxPdfDocument 0.8.0 released Next: Link and build problems when using 2.8.0 |