* Purpose: wxSocket: client demo
* Author: LAVAUX Guilhem
* Created: June 1997
- * Updated:
+ * CVS ID: $Id$
* Copyright: (c) 1997, LAVAUX Guilhem
*/
#include "wx/socket.h"
#include "wx/url.h"
#include "wx/protocol/http.h"
+#include "wx/thread.h"
#if defined(__WXMOTIF__) || defined(__WXGTK__)
#include "mondrian.xpm"
wxSocketHandler::Master();
sock = new MyClient();
- sock->SetFlags(wxSocketBase::WAITALL);
+ sock->SetFlags((wxSocketBase::wxSockFlags) (wxSocketBase::WAITALL | wxSocketBase::SPEED));
wxSocketHandler::Master().Register(sock);
sock->frame = this;
sock->SetNotify(wxSocketBase::REQ_LOST);
wxURL url(urlname);
wxInputStream *datas = url.GetInputStream();
- if (!datas)
- wxMessageBox("Error in getting data from the URL.", "Alert !");
- else {
+ if (!datas) {
+ wxString error;
+ error.Printf(_T("Error in getting data from the URL. (error = %d)"), url.GetError());
+ wxMessageBox(error, "Alert !");
+ } else {
wxFileOutputStream *str_out = new wxFileOutputStream("test.url");
str_out->Write(*datas);
- wxMessageBox("Success !! Click on OK to see the text.", "OK");
+ wxMessageBox(_T("Success !! Click on OK to see the text."), "OK");
delete datas;
delete str_out;
}