Зависает GUI при вызове wxSocketBase::Read()
{
wxSocketClient * socket = new wxSocketClient();
wxString data = "home=Cosby&favorite+flavor=flies";
wxString host = "www.google.com";
wxString path = "";//can be php or any other file
//Set up header
wxString header = "";
//POST
header += "GET ";
header += path;
header += " HTTP/1.0\n";
//Write host website name
header += "Host: ";
header += host;
header += "\n";
//Write user agent
header += "User-Agent: HTTPTool/1.0\n";
//Write POST content length
header += "Content-Length: ";
header += wxString::Format("%d", data.Len());
header += "\n";
//Write content type
header += "Content-Type: application/x-www-form-urlencoded\n";
header += "\n";
//Print on screen to make sure it looks right
wxMessageBox(header);
//Connect to host
wxIPV4address * address = new wxIPV4address();
address->Hostname(host);
address->Service(80);
if (socket->Connect(*address))
wxMessageBox("connected");
//Write header
// socket->Write(header.c_str(),header.Len());
// wxMessageBox(wxString::Format("Wrote %d out of %d bytes",socket->LastCount(),header.Len()));
//Write data
socket->Write(data.c_str(),data.Len());
wxMessageBox(wxString::Format("Wrote %d out of %d bytes",socket->LastCount(),data.Len()));
//Get Response
wxString buf;
socket->Read(buf.GetWriteBuf(1000),1000); //ВОТ ЗДЕСЬ ЗАВИСАЕТ
buf.UngetWriteBuf();
//Trim response to what was read from stream
buf = buf.SubString(0,socket->LastCount()-1);
wxMessageBox(wxString::Format("Read %d bytes: %s",socket->LastCount(),buf));
}
Посмотри в сторону