1998-09-06 14:28:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: socket.h
|
|
|
|
// Purpose: Socket handling classes
|
1999-09-11 16:29:50 -04:00
|
|
|
// Authors: Guilhem Lavaux, Guillermo Rodriguez Garcia
|
1998-09-06 14:28:00 -04:00
|
|
|
// Modified by:
|
|
|
|
// Created: April 1997
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Guilhem Lavaux
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-06 14:28:00 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1998-09-10 07:41:14 -04:00
|
|
|
|
2005-02-14 18:53:48 -05:00
|
|
|
#ifndef _WX_SOCKET_H_
|
|
|
|
#define _WX_SOCKET_H_
|
1998-09-06 14:28:00 -04:00
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_SOCKETS
|
|
|
|
|
1998-09-06 14:28:00 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
2000-03-07 11:11:58 -05:00
|
|
|
// wxSocket headers
|
1998-09-06 14:28:00 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
1999-09-30 19:53:10 -04:00
|
|
|
|
2004-07-25 12:44:47 -04:00
|
|
|
#include "wx/event.h"
|
1999-08-20 18:52:21 -04:00
|
|
|
#include "wx/sckaddr.h"
|
1999-07-29 01:27:19 -04:00
|
|
|
#include "wx/gsocket.h"
|
2002-09-04 12:42:53 -04:00
|
|
|
#include "wx/list.h"
|
1998-09-06 14:28:00 -04:00
|
|
|
|
1999-09-05 01:51:05 -04:00
|
|
|
// ------------------------------------------------------------------------
|
2000-03-07 11:11:58 -05:00
|
|
|
// Types and constants
|
1999-09-05 01:51:05 -04:00
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
1999-10-21 15:44:11 -04:00
|
|
|
enum wxSocketNotify
|
|
|
|
{
|
1999-09-05 01:51:05 -04:00
|
|
|
wxSOCKET_INPUT = GSOCK_INPUT,
|
|
|
|
wxSOCKET_OUTPUT = GSOCK_OUTPUT,
|
|
|
|
wxSOCKET_CONNECTION = GSOCK_CONNECTION,
|
|
|
|
wxSOCKET_LOST = GSOCK_LOST
|
1999-10-21 15:44:11 -04:00
|
|
|
};
|
1999-09-05 01:51:05 -04:00
|
|
|
|
1999-10-21 15:44:11 -04:00
|
|
|
enum
|
|
|
|
{
|
1999-09-05 01:51:05 -04:00
|
|
|
wxSOCKET_INPUT_FLAG = GSOCK_INPUT_FLAG,
|
|
|
|
wxSOCKET_OUTPUT_FLAG = GSOCK_OUTPUT_FLAG,
|
|
|
|
wxSOCKET_CONNECTION_FLAG = GSOCK_CONNECTION_FLAG,
|
1999-09-09 17:22:51 -04:00
|
|
|
wxSOCKET_LOST_FLAG = GSOCK_LOST_FLAG
|
1999-09-05 01:51:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef GSocketEventFlags wxSocketEventFlags;
|
|
|
|
|
1999-10-21 15:44:11 -04:00
|
|
|
enum wxSocketError
|
|
|
|
{
|
2000-03-16 16:57:20 -05:00
|
|
|
// from GSocket
|
1999-09-05 01:51:05 -04:00
|
|
|
wxSOCKET_NOERROR = GSOCK_NOERROR,
|
2000-03-16 16:57:20 -05:00
|
|
|
wxSOCKET_INVOP = GSOCK_INVOP,
|
1999-09-05 01:51:05 -04:00
|
|
|
wxSOCKET_IOERR = GSOCK_IOERR,
|
|
|
|
wxSOCKET_INVADDR = GSOCK_INVADDR,
|
|
|
|
wxSOCKET_INVSOCK = GSOCK_INVSOCK,
|
|
|
|
wxSOCKET_NOHOST = GSOCK_NOHOST,
|
|
|
|
wxSOCKET_INVPORT = GSOCK_INVPORT,
|
|
|
|
wxSOCKET_WOULDBLOCK = GSOCK_WOULDBLOCK,
|
1999-09-05 06:23:22 -04:00
|
|
|
wxSOCKET_TIMEDOUT = GSOCK_TIMEDOUT,
|
2000-03-16 16:57:20 -05:00
|
|
|
wxSOCKET_MEMERR = GSOCK_MEMERR,
|
|
|
|
|
|
|
|
// wxSocket-specific (not yet implemented)
|
|
|
|
wxSOCKET_DUMMY
|
1999-10-21 15:44:11 -04:00
|
|
|
};
|
1999-09-05 01:51:05 -04:00
|
|
|
|
1999-10-21 15:44:11 -04:00
|
|
|
enum
|
|
|
|
{
|
1999-09-30 19:53:10 -04:00
|
|
|
wxSOCKET_NONE = 0,
|
|
|
|
wxSOCKET_NOWAIT = 1,
|
|
|
|
wxSOCKET_WAITALL = 2,
|
2004-07-25 13:06:01 -04:00
|
|
|
wxSOCKET_BLOCK = 4,
|
|
|
|
wxSOCKET_REUSEADDR = 8
|
1999-09-30 19:53:10 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
enum wxSocketType
|
1999-10-21 15:44:11 -04:00
|
|
|
{
|
2000-03-07 11:11:58 -05:00
|
|
|
wxSOCKET_UNINIT,
|
|
|
|
wxSOCKET_CLIENT,
|
|
|
|
wxSOCKET_SERVER,
|
|
|
|
wxSOCKET_BASE,
|
|
|
|
wxSOCKET_DATAGRAM
|
1999-10-21 15:44:11 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
typedef int wxSocketFlags;
|
1999-09-30 19:53:10 -04:00
|
|
|
|
1999-09-05 01:51:05 -04:00
|
|
|
|
2000-03-10 00:31:53 -05:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// wxSocketBase
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2003-07-27 18:41:06 -04:00
|
|
|
class WXDLLIMPEXP_NET wxSocketBase : public wxObject
|
1998-09-06 14:28:00 -04:00
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxSocketBase)
|
2000-03-07 11:11:58 -05:00
|
|
|
|
|
|
|
public:
|
2000-01-09 22:54:37 -05:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// Public interface
|
|
|
|
// ----------------
|
1999-07-29 01:27:19 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// ctors and dtors
|
1998-09-06 14:28:00 -04:00
|
|
|
wxSocketBase();
|
2000-03-07 11:11:58 -05:00
|
|
|
wxSocketBase(wxSocketFlags flags, wxSocketType type);
|
1998-09-06 14:28:00 -04:00
|
|
|
virtual ~wxSocketBase();
|
2000-03-07 11:11:58 -05:00
|
|
|
void Init();
|
|
|
|
bool Destroy();
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// state
|
2006-10-08 17:56:55 -04:00
|
|
|
inline bool Ok() const { return IsOk(); }
|
2007-04-14 05:58:37 -04:00
|
|
|
inline bool IsOk() const { return (m_socket != NULL); }
|
|
|
|
inline bool Error() const { return m_error; }
|
|
|
|
inline bool IsConnected() const { return m_connected; }
|
|
|
|
inline bool IsData() { return WaitForRead(0, 0); }
|
|
|
|
inline bool IsDisconnected() const { return !IsConnected(); }
|
1999-09-05 06:23:22 -04:00
|
|
|
inline wxUint32 LastCount() const { return m_lcount; }
|
2004-08-06 18:14:59 -04:00
|
|
|
inline wxSocketError LastError() const { return (wxSocketError)m_socket->GetError(); }
|
2000-03-07 11:11:58 -05:00
|
|
|
void SaveState();
|
|
|
|
void RestoreState();
|
1999-07-29 01:27:19 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// addresses
|
1999-09-14 20:04:44 -04:00
|
|
|
virtual bool GetLocal(wxSockAddress& addr_man) const;
|
2000-03-07 11:11:58 -05:00
|
|
|
virtual bool GetPeer(wxSockAddress& addr_man) const;
|
2006-02-27 21:04:29 -05:00
|
|
|
virtual bool SetLocal(wxIPV4address& local);
|
1999-09-14 20:04:44 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// base IO
|
|
|
|
virtual bool Close();
|
|
|
|
wxSocketBase& Discard();
|
2000-03-08 03:28:20 -05:00
|
|
|
wxSocketBase& Peek(void* buffer, wxUint32 nbytes);
|
|
|
|
wxSocketBase& Read(void* buffer, wxUint32 nbytes);
|
|
|
|
wxSocketBase& ReadMsg(void *buffer, wxUint32 nbytes);
|
|
|
|
wxSocketBase& Unread(const void *buffer, wxUint32 nbytes);
|
|
|
|
wxSocketBase& Write(const void *buffer, wxUint32 nbytes);
|
|
|
|
wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes);
|
2000-03-07 11:11:58 -05:00
|
|
|
|
2007-04-14 05:58:37 -04:00
|
|
|
void InterruptWait() { m_interrupt = true; }
|
1999-09-05 06:23:22 -04:00
|
|
|
bool Wait(long seconds = -1, long milliseconds = 0);
|
|
|
|
bool WaitForRead(long seconds = -1, long milliseconds = 0);
|
|
|
|
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
|
|
|
|
bool WaitForLost(long seconds = -1, long milliseconds = 0);
|
1999-07-29 01:27:19 -04:00
|
|
|
|
2000-03-08 03:28:20 -05:00
|
|
|
inline wxSocketFlags GetFlags() const { return m_flags; }
|
2000-03-07 11:11:58 -05:00
|
|
|
void SetFlags(wxSocketFlags flags);
|
|
|
|
void SetTimeout(long seconds);
|
1999-07-29 01:27:19 -04:00
|
|
|
|
2004-07-25 07:16:31 -04:00
|
|
|
bool GetOption(int level, int optname, void *optval, int *optlen);
|
|
|
|
bool SetOption(int level, int optname, const void *optval, int optlen);
|
2007-04-14 05:58:37 -04:00
|
|
|
inline wxUint32 GetLastIOSize() const { return m_lcount; }
|
2004-07-25 07:16:31 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// event handling
|
2000-03-08 03:28:20 -05:00
|
|
|
void *GetClientData() const { return m_clientData; }
|
|
|
|
void SetClientData(void *data) { m_clientData = data; }
|
2004-09-22 10:38:52 -04:00
|
|
|
void SetEventHandler(wxEvtHandler& handler, int id = wxID_ANY);
|
1999-09-05 01:51:05 -04:00
|
|
|
void SetNotify(wxSocketEventFlags flags);
|
1999-09-14 20:04:44 -04:00
|
|
|
void Notify(bool notify);
|
|
|
|
|
2002-02-24 08:51:43 -05:00
|
|
|
// initialize/shutdown the sockets (usually called automatically)
|
|
|
|
static bool IsInitialized();
|
|
|
|
static bool Initialize();
|
|
|
|
static void Shutdown();
|
|
|
|
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// Implementation from now on
|
|
|
|
// --------------------------
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2000-03-16 16:57:20 -05:00
|
|
|
// do not use, should be private (called from GSocket)
|
2000-03-10 00:31:53 -05:00
|
|
|
void OnRequest(wxSocketNotify notify);
|
1999-01-19 06:00:22 -05:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// do not use, not documented nor supported
|
2000-03-10 00:31:53 -05:00
|
|
|
inline bool IsNoWait() const { return ((m_flags & wxSOCKET_NOWAIT) != 0); }
|
2000-03-07 11:11:58 -05:00
|
|
|
inline wxSocketType GetType() const { return m_type; }
|
1999-01-19 06:00:22 -05:00
|
|
|
|
2000-03-07 12:16:54 -05:00
|
|
|
private:
|
|
|
|
friend class wxSocketClient;
|
|
|
|
friend class wxSocketServer;
|
|
|
|
friend class wxDatagramSocket;
|
1999-07-29 01:27:19 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// low level IO
|
2000-03-08 03:28:20 -05:00
|
|
|
wxUint32 _Read(void* buffer, wxUint32 nbytes);
|
|
|
|
wxUint32 _Write(const void *buffer, wxUint32 nbytes);
|
2000-03-16 16:57:20 -05:00
|
|
|
bool _Wait(long seconds, long milliseconds, wxSocketEventFlags flags);
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// pushback buffer
|
2000-03-16 16:57:20 -05:00
|
|
|
void Pushback(const void *buffer, wxUint32 size);
|
2000-03-08 03:28:20 -05:00
|
|
|
wxUint32 GetPushback(void *buffer, wxUint32 size, bool peek);
|
2000-03-07 11:11:58 -05:00
|
|
|
|
2000-03-07 12:16:54 -05:00
|
|
|
private:
|
2000-03-16 16:57:20 -05:00
|
|
|
// socket
|
2000-03-07 11:11:58 -05:00
|
|
|
GSocket *m_socket; // GSocket
|
|
|
|
wxSocketType m_type; // wxSocket type
|
|
|
|
|
|
|
|
// state
|
|
|
|
wxSocketFlags m_flags; // wxSocket flags
|
|
|
|
bool m_connected; // connected?
|
|
|
|
bool m_establishing; // establishing connection?
|
|
|
|
bool m_reading; // busy reading?
|
|
|
|
bool m_writing; // busy writing?
|
|
|
|
bool m_error; // did last IO call fail?
|
2000-03-16 16:57:20 -05:00
|
|
|
wxSocketError m_lasterror; // last error (not cleared on success)
|
2000-03-07 11:11:58 -05:00
|
|
|
wxUint32 m_lcount; // last IO transaction size
|
|
|
|
unsigned long m_timeout; // IO timeout value
|
|
|
|
wxList m_states; // stack of states
|
|
|
|
bool m_interrupt; // interrupt ongoing wait operations?
|
|
|
|
bool m_beingDeleted; // marked for delayed deletion?
|
2006-02-27 21:04:29 -05:00
|
|
|
wxIPV4address m_localAddress; // bind to local address?
|
2000-03-07 11:11:58 -05:00
|
|
|
|
|
|
|
// pushback buffer
|
2000-03-08 03:28:20 -05:00
|
|
|
void *m_unread; // pushback buffer
|
2000-03-07 11:11:58 -05:00
|
|
|
wxUint32 m_unrd_size; // pushback buffer size
|
|
|
|
wxUint32 m_unrd_cur; // pushback pointer (index into buffer)
|
|
|
|
|
|
|
|
// events
|
|
|
|
int m_id; // socket id
|
2000-03-08 03:28:20 -05:00
|
|
|
wxEvtHandler *m_handler; // event handler
|
|
|
|
void *m_clientData; // client data for events
|
2000-03-10 00:31:53 -05:00
|
|
|
bool m_notify; // notify events to users?
|
|
|
|
wxSocketEventFlags m_eventmask; // which events to notify?
|
2000-03-08 03:28:20 -05:00
|
|
|
|
2002-02-24 08:51:43 -05:00
|
|
|
// the initialization count, GSocket is initialized if > 0
|
|
|
|
static size_t m_countInit;
|
|
|
|
|
2006-02-11 18:39:25 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxSocketBase)
|
1998-09-06 14:28:00 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// wxSocketServer
|
|
|
|
// --------------------------------------------------------------------------
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2003-07-27 18:41:06 -04:00
|
|
|
class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase
|
1998-09-06 14:28:00 -04:00
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxSocketServer)
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
public:
|
2005-09-24 17:43:15 -04:00
|
|
|
wxSocketServer(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE);
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2004-09-22 10:38:52 -04:00
|
|
|
wxSocketBase* Accept(bool wait = true);
|
|
|
|
bool AcceptWith(wxSocketBase& socket, bool wait = true);
|
1999-09-09 18:08:31 -04:00
|
|
|
|
1999-09-14 20:04:44 -04:00
|
|
|
bool WaitForAccept(long seconds = -1, long milliseconds = 0);
|
2003-01-11 15:57:16 -05:00
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxSocketServer)
|
1998-09-06 14:28:00 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// wxSocketClient
|
|
|
|
// --------------------------------------------------------------------------
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2003-07-27 18:41:06 -04:00
|
|
|
class WXDLLIMPEXP_NET wxSocketClient : public wxSocketBase
|
1998-09-06 14:28:00 -04:00
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxSocketClient)
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
public:
|
|
|
|
wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE);
|
1998-09-06 14:28:00 -04:00
|
|
|
virtual ~wxSocketClient();
|
|
|
|
|
2004-09-22 10:38:52 -04:00
|
|
|
virtual bool Connect(wxSockAddress& addr, bool wait = true);
|
2006-04-01 23:56:18 -05:00
|
|
|
bool Connect(wxSockAddress& addr, wxSockAddress& local, bool wait = true);
|
1998-09-06 14:28:00 -04:00
|
|
|
|
1999-09-05 06:23:22 -04:00
|
|
|
bool WaitOnConnect(long seconds = -1, long milliseconds = 0);
|
2003-01-11 15:57:16 -05:00
|
|
|
|
2006-02-11 18:39:25 -05:00
|
|
|
private:
|
|
|
|
virtual bool DoConnect(wxSockAddress& addr, wxSockAddress* local, bool wait = true);
|
|
|
|
|
2003-01-11 15:57:16 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxSocketClient)
|
1998-09-06 14:28:00 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// wxDatagramSocket
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// WARNING: still in alpha stage
|
2000-01-14 05:04:12 -05:00
|
|
|
|
2003-07-27 18:41:06 -04:00
|
|
|
class WXDLLIMPEXP_NET wxDatagramSocket : public wxSocketBase
|
2000-01-14 05:04:12 -05:00
|
|
|
{
|
|
|
|
DECLARE_CLASS(wxDatagramSocket)
|
|
|
|
|
|
|
|
public:
|
2005-09-24 17:43:15 -04:00
|
|
|
wxDatagramSocket(const wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE);
|
2000-01-14 05:04:12 -05:00
|
|
|
|
|
|
|
wxDatagramSocket& RecvFrom( wxSockAddress& addr,
|
2000-03-08 03:28:20 -05:00
|
|
|
void* buf,
|
2000-01-14 05:04:12 -05:00
|
|
|
wxUint32 nBytes );
|
2005-09-24 17:43:15 -04:00
|
|
|
wxDatagramSocket& SendTo( const wxSockAddress& addr,
|
2000-03-08 03:28:20 -05:00
|
|
|
const void* buf,
|
2000-01-14 05:04:12 -05:00
|
|
|
wxUint32 nBytes );
|
2000-03-16 16:57:20 -05:00
|
|
|
|
|
|
|
/* TODO:
|
|
|
|
bool Connect(wxSockAddress& addr);
|
|
|
|
*/
|
2003-01-11 15:57:16 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDatagramSocket)
|
2000-01-14 05:04:12 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// wxSocketEvent
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2003-07-27 18:41:06 -04:00
|
|
|
class WXDLLIMPEXP_NET wxSocketEvent : public wxEvent
|
2000-03-07 11:11:58 -05:00
|
|
|
{
|
1998-09-06 14:28:00 -04:00
|
|
|
public:
|
2001-11-21 12:25:08 -05:00
|
|
|
wxSocketEvent(int id = 0)
|
|
|
|
: wxEvent(id, wxEVT_SOCKET)
|
|
|
|
{
|
|
|
|
}
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2000-03-08 03:28:20 -05:00
|
|
|
wxSocketNotify GetSocketEvent() const { return m_event; }
|
|
|
|
wxSocketBase *GetSocket() const { return (wxSocketBase *) GetEventObject(); }
|
|
|
|
void *GetClientData() const { return m_clientData; }
|
|
|
|
|
2001-11-21 12:25:08 -05:00
|
|
|
virtual wxEvent *Clone() const { return new wxSocketEvent(*this); }
|
1999-05-07 14:34:32 -04:00
|
|
|
|
1998-09-06 14:28:00 -04:00
|
|
|
public:
|
2000-03-07 11:11:58 -05:00
|
|
|
wxSocketNotify m_event;
|
2000-03-08 03:28:20 -05:00
|
|
|
void *m_clientData;
|
2001-11-21 12:25:08 -05:00
|
|
|
|
2003-07-22 07:13:50 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSocketEvent)
|
1998-09-06 14:28:00 -04:00
|
|
|
};
|
|
|
|
|
2000-03-07 11:11:58 -05:00
|
|
|
|
1998-09-06 14:28:00 -04:00
|
|
|
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
|
|
|
|
|
2005-02-14 18:53:48 -05:00
|
|
|
#define wxSocketEventHandler(func) \
|
2005-03-08 15:53:16 -05:00
|
|
|
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func)
|
2005-02-14 18:53:48 -05:00
|
|
|
|
2001-01-31 12:16:40 -05:00
|
|
|
#define EVT_SOCKET(id, func) \
|
2005-02-14 18:53:48 -05:00
|
|
|
wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func))
|
1998-09-06 14:28:00 -04:00
|
|
|
|
2005-02-14 18:53:48 -05:00
|
|
|
#endif // wxUSE_SOCKETS
|
2000-03-07 11:11:58 -05:00
|
|
|
|
2005-02-14 18:53:48 -05:00
|
|
|
#endif // _WX_SOCKET_H_
|
1999-06-15 16:21:59 -04:00
|
|
|
|