+
+ // Tell the server which test we are running
+ char c = 0xDE;
+ m_sock->Write(&c, 1);
+
+ // This test also is similar to the first one but it sends a
+ // large buffer so that wxSocket is actually forced to split
+ // it into pieces and take care of sending everything before
+ // returning.
+ //
+ m_sock->SetFlags(wxSOCKET_WAITALL);
+
+ // Note that len is in kbytes here!
+ len = 32;
+ buf1 = new char[len * 1024];
+ buf2 = new char[len * 1024];
+
+ for (int i = 0; i < len * 1024; i ++)
+ buf1[i] = (char)(i % 256);
+
+ m_text->AppendText(_T("Sending a large buffer (32K) to the server ..."));
+ m_sock->Write((char *)&len, 1);
+ m_sock->Write(buf1, len * 1024);
+ m_text->AppendText(m_sock->Error() ? _T("failed !\n") : _T("done\n"));
+
+ m_text->AppendText(_T("Receiving the buffer back from server ..."));
+ m_sock->Read(buf2, len * 1024);
+ m_text->AppendText(m_sock->Error() ? _T("failed !\n") : _T("done\n"));
+
+ m_text->AppendText(_T("Comparing the two buffers ..."));
+ if (memcmp(buf1, buf2, len) != 0)
+ {
+ m_text->AppendText(_T("failed!\n"));
+ m_text->AppendText(_T("Test 3 failed !\n"));
+ }
+ else
+ {
+ m_text->AppendText(_T("done\n"));
+ m_text->AppendText(_T("Test 3 passed !\n"));
+ }