From 0ed00ab5be4bb5108ebafeebcaa26274145debe0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Jan 2009 02:20:25 +0000 Subject: [PATCH] restore code preventing the events being generated from inside our own DoRead/Write() mistakenly removed in r57796 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/socket.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 88937119b1..c80b314d60 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -1563,6 +1563,15 @@ void wxSocketBase::OnRequest(wxSocketNotify notification) // send the wx event if enabled and we're interested in it if ( m_notify && (m_eventmask & flag) && m_handler ) { + // don't generate the events when we're inside DoWait() called from our + // own code as we are going to consume the data that has just become + // available ourselves and the user code won't see it at all + if ( (notification == wxSOCKET_INPUT && m_reading) || + (notification == wxSOCKET_OUTPUT && m_writing) ) + { + return; + } + wxSocketEvent event(m_id); event.m_event = notification; event.m_clientData = m_clientData; -- 2.45.2