+ text_win->WriteText("done\nTest 1A passed !\n");
+
+ /* No 2 */
+ sock->SetEventHandler(*this, SKDEMO_SCK);
+ sock->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
+ sock->Notify(TRUE);
+ text_win->WriteText("Test 1B: sending bytes to the server\n");
+ if (!sock->IsData())
+ text_win->WriteText("No data to read yet (this is OK)\n");
+
+ wxYield();
+ sock->Write((char *)buf, wxStrlen(buf)+1);
+ text_win->WriteText("Waiting for incoming bytes (timeout = 2 sec) ...");
+ wxYield();
+
+ m_good = 2;
+
+ MyFrameSocketTimer timer;
+
+ timer.m_var = &m_good;
+ timer.Start(2000, TRUE);
+
+ while (m_good == 2)
+ wxYield();
+
+ if (!m_good) {
+ text_win->WriteText("timeout ! Failed.\n");
+ sock->Close();
+ UpdateStatus();
+ } else
+ text_win->WriteText("event ! (no timeout).\n");
+
+ if (sock->IsData())
+ text_win->WriteText("Data is available, as expected...\n");
+
+ sock->Read((char *)buf2, wxStrlen(buf)+1);
+
+ text_win->WriteText("Success!\n");