I have some problems with using wxHTTP inside a Thread. I have created below class which derive from wxThread to use wxHTTP.
class Thread : public wxThread {
private:
wxHTTP get;
public:
Thread()
{
}
~Thread()
{
}
virtual ExitCode Entry()
{
get.SetHeader(wxT("Content-Type"), wxT("text/html; charset=utf-8"));
get.Connect(wxT("www.mysite.com"));
get.SetTimeout(1);
wxInputStream *httpStream = get.GetInputStream(wxT("/script.php?name=aaa&text=blabla"));
wxDELETE(httpStream);
get.Close();
return 0;
}
};
I create this thread and run it (threads are created, ran and everything is fine with them). Unfortunately wxHTTP seems to doesn't work properly with threads (even my firewall doesn't ask me about connection). Is there any way to create wxHTTP connection inside a thread?