2007-03-16 11:45:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/private/gsocketiohandler.h
|
|
|
|
// Purpose: class for registering GSocket in 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"
|
|
|
|
|
2007-12-19 11:45:08 -05:00
|
|
|
#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
2007-03-16 11:45:12 -04:00
|
|
|
|
2007-12-19 11:45:08 -05:00
|
|
|
#include "wx/private/selectdispatcher.h"
|
|
|
|
#include "wx/gsocket.h"
|
2007-03-16 11:45:12 -04:00
|
|
|
|
2007-12-19 11:45:08 -05:00
|
|
|
class WXDLLIMPEXP_BASE wxGSocketIOHandler : public wxFDIOHandler
|
2007-03-16 11:45:12 -04:00
|
|
|
{
|
|
|
|
public:
|
2007-12-19 11:45:08 -05:00
|
|
|
wxGSocketIOHandler(GSocket* 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; }
|
2007-03-16 11:45:12 -04:00
|
|
|
|
2007-12-19 11:45:08 -05:00
|
|
|
virtual void OnReadWaiting() { m_socket->Detected_Read(); }
|
|
|
|
virtual void OnWriteWaiting() { m_socket->Detected_Write(); }
|
|
|
|
virtual void OnExceptionWaiting() { m_socket->Detected_Read(); }
|
2007-03-16 11:45:12 -04:00
|
|
|
|
2007-05-14 19:43:39 -04:00
|
|
|
private:
|
2007-03-16 11:45:12 -04:00
|
|
|
GSocket* m_socket;
|
|
|
|
int m_flags;
|
|
|
|
};
|
|
|
|
|
2007-12-19 11:45:08 -05:00
|
|
|
#endif // wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
|
2007-03-16 11:45:12 -04:00
|
|
|
|
|
|
|
#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_
|