- len = sock->ReadMsg(buf, MAX_MSG_SIZE * sizeof(wxChar)).LastCount();
- s.Printf(_("Client says: %s\n"), buf);
- m_text->AppendText(s);
- m_text->AppendText(_("Sending the data back\n"));
+ wxUint32 len = sock->ReadMsg(buf, sizeof(buf)).LastCount();
+ if ( !len )
+ {
+ wxLogError("Failed to read message.");
+ return;
+ }
+
+ wxLogMessage("Got \"%s\" from client.", wxString::FromUTF8(buf, len));
+ wxLogMessage("Sending the data back");