remove m_use_events from Unix wxSocket implementation, we always need asynchronous socket notifications now (and this was always the case under Windows anyhow), even if we don't always generate wx events corresponding to them

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-26 20:20:46 +00:00
parent f521bae665
commit 22185a1f15
4 changed files with 13 additions and 59 deletions

View File

@@ -535,20 +535,10 @@ wxSocketImpl *wxSocketImplUnix::WaitConnection(wxSocketBase& wxsocket)
#else
ioctl(connection->m_fd, FIONBIO, &arg);
#endif
if (m_use_events)
connection->Notify(true);
return connection;
}
void wxSocketImplUnix::Notify(bool flag)
{
if (flag == m_use_events)
return;
m_use_events = flag;
DoEnableEvents(flag);
}
void wxSocketImplUnix::DoEnableEvents(bool flag)
{
wxSocketManager * const manager = wxSocketManager::Get();
@@ -672,12 +662,9 @@ int wxSocketImplUnix::Read(void *buffer, int size)
if ((ret == 0) && m_stream)
{
/* Make sure wxSOCKET_LOST event gets sent and shut down the socket */
if (m_use_events)
{
m_detected = wxSOCKET_LOST_FLAG;
OnReadWaiting();
return 0;
}
m_detected = wxSOCKET_LOST_FLAG;
OnReadWaiting();
return 0;
}
else if (ret == -1)
{
@@ -754,20 +741,14 @@ int wxSocketImplUnix::Write(const void *buffer, int size)
void wxSocketImplUnix::EnableEvent(wxSocketNotify event)
{
if (m_use_events)
{
m_detected &= ~(1 << event);
wxSocketManager::Get()->Install_Callback(this, event);
}
m_detected &= ~(1 << event);
wxSocketManager::Get()->Install_Callback(this, event);
}
void wxSocketImplUnix::DisableEvent(wxSocketNotify event)
{
if (m_use_events)
{
m_detected |= (1 << event);
wxSocketManager::Get()->Uninstall_Callback(this, event);
}
m_detected |= (1 << event);
wxSocketManager::Get()->Uninstall_Callback(this, event);
}
int wxSocketImplUnix::Recv_Stream(void *buffer, int size)