make wxSocketImplUnix inherit from wxFDIOHandler as they're used for almost the same purpose; this removes the need for the bridge wxSocketOHandler class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
// Purpose: wxSocketImpl nd related declarations
|
// Purpose: wxSocketImpl nd related declarations
|
||||||
// Authors: Guilhem Lavaux, Vadim Zeitlin
|
// Authors: Guilhem Lavaux, Vadim Zeitlin
|
||||||
// Created: April 1997
|
// Created: April 1997
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id: socket.h 56994 2008-11-28 12:47:07Z VZ $
|
||||||
// Copyright: (c) 1997 Guilhem Lavaux
|
// Copyright: (c) 1997 Guilhem Lavaux
|
||||||
// (c) 2008 Vadim Zeitlin
|
// (c) 2008 Vadim Zeitlin
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
@@ -275,12 +275,7 @@ public:
|
|||||||
// named) OnRequest() method
|
// named) OnRequest() method
|
||||||
void NotifyOnStateChange(wxSocketNotify event);
|
void NotifyOnStateChange(wxSocketNotify event);
|
||||||
|
|
||||||
// FIXME: making these functions virtual is a hack necessary to make the
|
// FIXME: this one probably isn't needed here at all
|
||||||
// wxBase library link without requiring wxNet under Unix where
|
|
||||||
// wxSocketSelectManager (part of wxBase) uses them, they don't
|
|
||||||
// really need to be virtual at all
|
|
||||||
virtual void Detected_Read() { }
|
|
||||||
virtual void Detected_Write() { }
|
|
||||||
virtual void Notify(bool WXUNUSED(notify)) { }
|
virtual void Notify(bool WXUNUSED(notify)) { }
|
||||||
|
|
||||||
// TODO: make these fields protected and provide accessors for those of
|
// TODO: make these fields protected and provide accessors for those of
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Name: wx/private/gsocketiohandler.h
|
|
||||||
// Purpose: class for registering sockets with wxSelectDispatcher
|
|
||||||
// Authors: Lukasz Michalski
|
|
||||||
// Created: December 2006
|
|
||||||
// Copyright: (c) Lukasz Michalski
|
|
||||||
// RCS-ID: $Id$
|
|
||||||
// Licence: wxWindows licence
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef _WX_PRIVATE_GSOCKETIOHANDLER_H_
|
|
||||||
#define _WX_PRIVATE_GSOCKETIOHANDLER_H_
|
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
|
|
||||||
#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
|
||||||
|
|
||||||
#include "wx/private/selectdispatcher.h"
|
|
||||||
#include "wx/private/socket.h"
|
|
||||||
|
|
||||||
class WXDLLIMPEXP_BASE wxSocketIOHandler : public wxFDIOHandler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
wxSocketIOHandler(wxSocketImpl *socket)
|
|
||||||
{
|
|
||||||
m_socket = socket;
|
|
||||||
m_flags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetFlags() const { return m_flags; }
|
|
||||||
void RemoveFlag(wxFDIODispatcherEntryFlags flag) { m_flags &= ~flag; }
|
|
||||||
void AddFlag(wxFDIODispatcherEntryFlags flag) { m_flags |= flag; }
|
|
||||||
|
|
||||||
virtual void OnReadWaiting() { m_socket->Detected_Read(); }
|
|
||||||
virtual void OnWriteWaiting() { m_socket->Detected_Write(); }
|
|
||||||
virtual void OnExceptionWaiting() { m_socket->Detected_Read(); }
|
|
||||||
|
|
||||||
private:
|
|
||||||
wxSocketImpl *m_socket;
|
|
||||||
int m_flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
|
||||||
|
|
||||||
#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_
|
|
@@ -14,8 +14,10 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include "wx/private/fdiodispatcher.h"
|
||||||
|
|
||||||
class wxSocketImplUnix : public wxSocketImpl
|
class wxSocketImplUnix : public wxSocketImpl,
|
||||||
|
public wxFDIOHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxSocketImplUnix(wxSocketBase& wxsocket)
|
wxSocketImplUnix(wxSocketBase& wxsocket)
|
||||||
@@ -34,8 +36,11 @@ public:
|
|||||||
int Write(const char *buffer, int size);
|
int Write(const char *buffer, int size);
|
||||||
//attach or detach from main loop
|
//attach or detach from main loop
|
||||||
void Notify(bool flag);
|
void Notify(bool flag);
|
||||||
void Detected_Read();
|
|
||||||
void Detected_Write();
|
// wxFDIOHandler methods
|
||||||
|
virtual void OnReadWaiting();
|
||||||
|
virtual void OnWriteWaiting();
|
||||||
|
virtual void OnExceptionWaiting();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual wxSocketError DoHandleConnect(int ret);
|
virtual wxSocketError DoHandleConnect(int ret);
|
||||||
@@ -160,9 +165,9 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// access the FDs we store
|
// access the FDs we store
|
||||||
int& FD(wxSocketImpl *socket, SocketDir d)
|
int& FD(wxSocketImplUnix *socket, SocketDir d)
|
||||||
{
|
{
|
||||||
return static_cast<wxSocketImplUnix *>(socket)->m_fds[d];
|
return socket->m_fds[d];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -171,8 +176,11 @@ protected:
|
|||||||
class wxSocketInputBasedManager : public wxSocketFDBasedManager
|
class wxSocketInputBasedManager : public wxSocketFDBasedManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Install_Callback(wxSocketImpl *socket, wxSocketNotify event)
|
virtual void Install_Callback(wxSocketImpl *socket_, wxSocketNotify event)
|
||||||
{
|
{
|
||||||
|
wxSocketImplUnix * const
|
||||||
|
socket = static_cast<wxSocketImplUnix *>(socket_);
|
||||||
|
|
||||||
wxCHECK_RET( socket->m_fd != -1,
|
wxCHECK_RET( socket->m_fd != -1,
|
||||||
"shouldn't be called on invalid socket" );
|
"shouldn't be called on invalid socket" );
|
||||||
|
|
||||||
@@ -182,11 +190,14 @@ public:
|
|||||||
if ( fd != -1 )
|
if ( fd != -1 )
|
||||||
RemoveInput(fd);
|
RemoveInput(fd);
|
||||||
|
|
||||||
fd = AddInput(socket, d);
|
fd = AddInput(socket, socket->m_fd, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Uninstall_Callback(wxSocketImpl *socket, wxSocketNotify event)
|
virtual void Uninstall_Callback(wxSocketImpl *socket_, wxSocketNotify event)
|
||||||
{
|
{
|
||||||
|
wxSocketImplUnix * const
|
||||||
|
socket = static_cast<wxSocketImplUnix *>(socket_);
|
||||||
|
|
||||||
const SocketDir d = GetDirForEvent(socket, event);
|
const SocketDir d = GetDirForEvent(socket, event);
|
||||||
|
|
||||||
int& fd = FD(socket, d);
|
int& fd = FD(socket, d);
|
||||||
@@ -200,7 +211,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
// these functions map directly to XtAdd/RemoveInput() or
|
// these functions map directly to XtAdd/RemoveInput() or
|
||||||
// gdk_input_add/remove()
|
// gdk_input_add/remove()
|
||||||
virtual int AddInput(wxSocketImpl *socket, SocketDir d) = 0;
|
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d) = 0;
|
||||||
virtual void RemoveInput(int fd) = 0;
|
virtual void RemoveInput(int fd) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -23,8 +23,7 @@
|
|||||||
#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
||||||
|
|
||||||
#include "wx/apptrait.h"
|
#include "wx/apptrait.h"
|
||||||
#include "wx/unix/private.h"
|
#include "wx/private/socket.h"
|
||||||
#include "wx/private/socketiohandler.h"
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
@@ -40,15 +39,14 @@ public:
|
|||||||
wxSocketImplFDIO(wxSocketBase& wxsocket)
|
wxSocketImplFDIO(wxSocketBase& wxsocket)
|
||||||
: wxSocketImplUnix(wxsocket)
|
: wxSocketImplUnix(wxsocket)
|
||||||
{
|
{
|
||||||
m_handler = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~wxSocketImplFDIO()
|
int GetFlags() const { return m_flags; }
|
||||||
{
|
void RemoveFlag(wxFDIODispatcherEntryFlags flag) { m_flags &= ~flag; }
|
||||||
delete m_handler;
|
void AddFlag(wxFDIODispatcherEntryFlags flag) { m_flags |= flag; }
|
||||||
}
|
|
||||||
|
|
||||||
wxSocketIOHandler *m_handler;
|
private:
|
||||||
|
int m_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -83,34 +81,18 @@ void wxSocketSelectManager::Install_Callback(wxSocketImpl *socket_,
|
|||||||
if ( !dispatcher )
|
if ( !dispatcher )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxSocketIOHandler *& handler = socket->m_handler;
|
|
||||||
|
|
||||||
// we should register the new handlers but modify the existing ones in place
|
|
||||||
bool registerHandler;
|
|
||||||
if ( handler )
|
|
||||||
{
|
|
||||||
registerHandler = false;
|
|
||||||
}
|
|
||||||
else // no existing handler
|
|
||||||
{
|
|
||||||
registerHandler = true;
|
|
||||||
handler = new wxSocketIOHandler(socket);
|
|
||||||
}
|
|
||||||
|
|
||||||
FD(socket, d) = fd;
|
FD(socket, d) = fd;
|
||||||
if (d == FD_INPUT)
|
|
||||||
{
|
// register it when it's used for the first time, update it if it had been
|
||||||
handler->AddFlag(wxFDIO_INPUT);
|
// previously registered
|
||||||
}
|
const bool registerHandler = socket->GetFlags() == 0;
|
||||||
else
|
|
||||||
{
|
socket->AddFlag(d == FD_INPUT ? wxFDIO_INPUT : wxFDIO_OUTPUT);
|
||||||
handler->AddFlag(wxFDIO_OUTPUT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( registerHandler )
|
if ( registerHandler )
|
||||||
dispatcher->RegisterFD(fd, handler, handler->GetFlags());
|
dispatcher->RegisterFD(fd, socket, socket->GetFlags());
|
||||||
else
|
else
|
||||||
dispatcher->ModifyFD(fd, handler, handler->GetFlags());
|
dispatcher->ModifyFD(fd, socket, socket->GetFlags());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSocketSelectManager::Uninstall_Callback(wxSocketImpl *socket_,
|
void wxSocketSelectManager::Uninstall_Callback(wxSocketImpl *socket_,
|
||||||
@@ -133,25 +115,15 @@ void wxSocketSelectManager::Uninstall_Callback(wxSocketImpl *socket_,
|
|||||||
if ( !dispatcher )
|
if ( !dispatcher )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxSocketIOHandler *& handler = socket->m_handler;
|
socket->RemoveFlag(flag);
|
||||||
if ( handler )
|
|
||||||
{
|
|
||||||
handler->RemoveFlag(flag);
|
|
||||||
|
|
||||||
if ( !handler->GetFlags() )
|
if ( !socket->GetFlags() )
|
||||||
{
|
{
|
||||||
dispatcher->UnregisterFD(fd);
|
dispatcher->UnregisterFD(fd);
|
||||||
delete handler;
|
|
||||||
socket->m_handler = NULL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dispatcher->ModifyFD(fd, handler, handler->GetFlags());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dispatcher->UnregisterFD(fd);
|
dispatcher->ModifyFD(fd, socket, socket->GetFlags());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,26 +28,26 @@ void wxSocket_GDK_Input(gpointer data,
|
|||||||
gint WXUNUSED(source),
|
gint WXUNUSED(source),
|
||||||
GdkInputCondition condition)
|
GdkInputCondition condition)
|
||||||
{
|
{
|
||||||
wxSocketImpl * const socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
if ( condition & GDK_INPUT_READ )
|
if ( condition & GDK_INPUT_READ )
|
||||||
socket->Detected_Read();
|
handler->OnReadWaiting();
|
||||||
if ( condition & GDK_INPUT_WRITE )
|
if ( condition & GDK_INPUT_WRITE )
|
||||||
socket->Detected_Write();
|
handler->OnWriteWaiting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GTKSocketManager : public wxSocketInputBasedManager
|
class GTKSocketManager : public wxSocketInputBasedManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual int AddInput(wxSocketImpl *socket, SocketDir d)
|
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d)
|
||||||
{
|
{
|
||||||
return gdk_input_add
|
return gdk_input_add
|
||||||
(
|
(
|
||||||
socket->m_fd,
|
fd,
|
||||||
d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ,
|
d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ,
|
||||||
wxSocket_GDK_Input,
|
wxSocket_GDK_Input,
|
||||||
socket
|
handler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,26 +28,26 @@ void wxSocket_GDK_Input(gpointer data,
|
|||||||
gint WXUNUSED(source),
|
gint WXUNUSED(source),
|
||||||
GdkInputCondition condition)
|
GdkInputCondition condition)
|
||||||
{
|
{
|
||||||
wxSocketImpl const *socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
if ( condition & GDK_INPUT_READ )
|
if ( condition & GDK_INPUT_READ )
|
||||||
socket->Detected_Read();
|
handler->OnReadWaiting();
|
||||||
if ( condition & GDK_INPUT_WRITE )
|
if ( condition & GDK_INPUT_WRITE )
|
||||||
socket->Detected_Write();
|
handler->OnWriteWaiting();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class GTKSocketManager : public wxSocketInputBasedManager
|
class GTKSocketManager : public wxSocketInputBasedManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual int AddInput(wxSocketImpl *socket, SocketDir d)
|
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d)
|
||||||
{
|
{
|
||||||
return gdk_input_add
|
return gdk_input_add
|
||||||
(
|
(
|
||||||
socket->m_fd,
|
fd,
|
||||||
d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ,
|
d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ,
|
||||||
wxSocket_GDK_Input,
|
wxSocket_GDK_Input,
|
||||||
socket
|
handler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: motif/gsockmot.cpp
|
// Name: motif/sockmot.cpp
|
||||||
// Purpose: implementation of wxMotif-specific socket event handling
|
// Purpose: implementation of wxMotif-specific socket event handling
|
||||||
// Author: Guilhem Lavaux, Vadim Zeitlin
|
// Author: Guilhem Lavaux, Vadim Zeitlin
|
||||||
// Created: 1999
|
// Created: 1999
|
||||||
@@ -23,17 +23,17 @@ extern "C" {
|
|||||||
static void wxSocket_Motif_Input(XtPointer data, int *WXUNUSED(fid),
|
static void wxSocket_Motif_Input(XtPointer data, int *WXUNUSED(fid),
|
||||||
XtInputId *WXUNUSED(id))
|
XtInputId *WXUNUSED(id))
|
||||||
{
|
{
|
||||||
wxSocketImpl * const socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
socket->Detected_Read();
|
handler->OnReadWaiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wxSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid),
|
static void wxSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid),
|
||||||
XtInputId *WXUNUSED(id))
|
XtInputId *WXUNUSED(id))
|
||||||
{
|
{
|
||||||
wxSocketImpl * const socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
socket->Detected_Write();
|
handler->OnWriteWaiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -41,17 +41,17 @@ static void wxSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid),
|
|||||||
class MotifSocketManager : public wxSocketInputBasedManager
|
class MotifSocketManager : public wxSocketInputBasedManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual int AddInput(wxSocketImpl *socket, SocketDir d)
|
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d)
|
||||||
{
|
{
|
||||||
return XtAppAddInput
|
return XtAppAddInput
|
||||||
(
|
(
|
||||||
wxGetAppContext(),
|
wxGetAppContext(),
|
||||||
socket->m_fd,
|
fd,
|
||||||
(XtPointer)(d == FD_OUTPUT ? XtInputWriteMask
|
(XtPointer)(d == FD_OUTPUT ? XtInputWriteMask
|
||||||
: XtInputReadMask),
|
: XtInputReadMask),
|
||||||
d == FD_OUTPUT ? wxSocket_Motif_Output
|
d == FD_OUTPUT ? wxSocket_Motif_Output
|
||||||
: wxSocket_Motif_Input,
|
: wxSocket_Motif_Input,
|
||||||
socket
|
handler
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
/* -------------------------------------------------------------------------
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
* Project: wxSocketImpl (Generic Socket) for WX
|
// Name: os2/sockpm.cpp
|
||||||
* Name: gsockpm.c
|
// Purpose: implementation of OS-2-specific handler event handling
|
||||||
* Purpose: wxSocketImpl: PM part
|
// Author: Guilhem Lavaux, Vadim Zeitlin
|
||||||
* Licence: The wxWindows licence
|
// Created: 1999
|
||||||
* CVSID: $Id$
|
// RCS-ID: $Id$
|
||||||
* ------------------------------------------------------------------------- */
|
// Copyright: (c) 1999-2008 wxWidgets dev team
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
@@ -21,30 +23,29 @@
|
|||||||
|
|
||||||
static void wxSocket_PM_Input(void *data)
|
static void wxSocket_PM_Input(void *data)
|
||||||
{
|
{
|
||||||
wxSocketImpl *socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler *handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
socket->Detected_Read();
|
handler->OnReadWaiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wxSocket_PM_Output(void *data)
|
static void wxSocket_PM_Output(void *data)
|
||||||
{
|
{
|
||||||
wxSocketImpl *socket = static_cast<wxSocketImpl *>(data);
|
wxFDIOHandler *handler = static_cast<wxFDIOHandler *>(data);
|
||||||
|
|
||||||
socket->Detected_Write();
|
handler->OnWriteWaiting();
|
||||||
}
|
}
|
||||||
|
|
||||||
class PMSocketManager : public wxSocketInputBasedManager
|
class PMSocketManager : public wxSocketInputBasedManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual int AddInput(wxSocketImpl *socket, SocketDir d)
|
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (d == FD_OUTPUT)
|
if (d == FD_OUTPUT)
|
||||||
return wxTheApp->AddSocketHandler(socket->m_fd, wxSockWriteMask,
|
return wxTheApp->AddSocketHandler(fd, wxSockWriteMask,
|
||||||
wxSocket_PM_Output, (void *)socket);
|
wxSocket_PM_Output, handler);
|
||||||
else
|
else
|
||||||
return wxTheApp->AddSocketHandler(socket->m_fd, wxSockReadMask,
|
return wxTheApp->AddSocketHandler(fd, wxSockReadMask,
|
||||||
wxSocket_PM_Input, (void *)socket);
|
wxSocket_PM_Input, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void RemoveInput(int fd)
|
virtual void RemoveInput(int fd)
|
||||||
|
@@ -672,7 +672,7 @@ int wxSocketImplUnix::Read(char *buffer, int size)
|
|||||||
if (m_use_events)
|
if (m_use_events)
|
||||||
{
|
{
|
||||||
m_detected = wxSOCKET_LOST_FLAG;
|
m_detected = wxSOCKET_LOST_FLAG;
|
||||||
Detected_Read();
|
OnReadWaiting();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -974,11 +974,10 @@ void wxSocketImplUnix::OnStateChange(wxSocketNotify event)
|
|||||||
Shutdown();
|
Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSocketImplUnix::Detected_Read()
|
void wxSocketImplUnix::OnReadWaiting()
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
/* Safeguard against straggling call to Detected_Read */
|
|
||||||
if (m_fd == INVALID_SOCKET)
|
if (m_fd == INVALID_SOCKET)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -1035,7 +1034,7 @@ void wxSocketImplUnix::Detected_Read()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSocketImplUnix::Detected_Write()
|
void wxSocketImplUnix::OnWriteWaiting()
|
||||||
{
|
{
|
||||||
/* If we have already detected a LOST event, then don't try
|
/* If we have already detected a LOST event, then don't try
|
||||||
* to do any further processing.
|
* to do any further processing.
|
||||||
@@ -1077,6 +1076,11 @@ void wxSocketImplUnix::Detected_Write()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxSocketImplUnix::OnExceptionWaiting()
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "not supposed to be called" );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
* GAddress
|
* GAddress
|
||||||
|
Reference in New Issue
Block a user