continuation of GSocket/wxSocket merge: always create GSocket associated to a wxSocket instead of (always) doing it using a separate call later; remove support for user callbacks which wasn't implemented in Windows version and deprecated since 10 years or so
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "wx/dlimpexp.h" /* for WXDLLIMPEXP_NET */
|
||||
|
||||
class WXDLLIMPEXP_FWD_NET wxSocketBase;
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/*
|
||||
@@ -163,13 +165,17 @@ private:
|
||||
class GSocketBase
|
||||
{
|
||||
public:
|
||||
// static factory function
|
||||
static GSocket *Create();
|
||||
// static factory function: creates the low-level socket associated with
|
||||
// the given wxSocket (and inherits its attributes such as timeout)
|
||||
static GSocket *Create(wxSocketBase& wxsocket);
|
||||
|
||||
void SetTimeout(unsigned long millisec);
|
||||
virtual ~GSocketBase();
|
||||
|
||||
GSocketEventFlags Select(GSocketEventFlags flags);
|
||||
|
||||
virtual GSocket *WaitConnection(wxSocketBase& wxsocket) = 0;
|
||||
|
||||
virtual void Close() = 0;
|
||||
virtual void Shutdown();
|
||||
|
||||
@@ -200,11 +206,19 @@ public:
|
||||
#endif
|
||||
|
||||
GSocketEventFlags m_detected;
|
||||
GSocketCallback m_cbacks[GSOCK_MAX_EVENT];
|
||||
char *m_data[GSOCK_MAX_EVENT];
|
||||
|
||||
protected:
|
||||
GSocketBase();
|
||||
GSocketBase(wxSocketBase& wxsocket);
|
||||
|
||||
// notify m_wxsocket
|
||||
void NotifyOnStateChange(GSocketEvent event);
|
||||
|
||||
private:
|
||||
// set in ctor and never changed except that it's reset to NULL when the
|
||||
// socket is shut down
|
||||
wxSocketBase *m_wxsocket;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(GSocketBase)
|
||||
};
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
|
Reference in New Issue
Block a user