// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
inline bool Error() const { return m_error; };
inline bool IsConnected() const { return m_connected; };
inline bool IsData() { return WaitForRead(0, 0); };
inline bool Error() const { return m_error; };
inline bool IsConnected() const { return m_connected; };
inline bool IsData() { return WaitForRead(0, 0); };
// addresses
virtual bool GetLocal(wxSockAddress& addr_man) const;
virtual bool GetPeer(wxSockAddress& addr_man) const;
// addresses
virtual bool GetLocal(wxSockAddress& addr_man) const;
virtual bool GetPeer(wxSockAddress& addr_man) const;
wxSocketBase& Write(const void *buffer, wxUint32 nbytes);
wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes);
wxSocketBase& Write(const void *buffer, wxUint32 nbytes);
wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes);
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 Wait(long seconds = -1, long milliseconds = 0);
bool WaitForRead(long seconds = -1, long milliseconds = 0);
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
// event handling
void *GetClientData() const { return m_clientData; }
void SetClientData(void *data) { m_clientData = data; }
// event handling
void *GetClientData() const { return m_clientData; }
void SetClientData(void *data) { m_clientData = data; }
wxList m_states; // stack of states
bool m_interrupt; // interrupt ongoing wait operations?
bool m_beingDeleted; // marked for delayed deletion?
wxList m_states; // stack of states
bool m_interrupt; // interrupt ongoing wait operations?
bool m_beingDeleted; // marked for delayed deletion?
// the initialization count, GSocket is initialized if > 0
static size_t m_countInit;
// the initialization count, GSocket is initialized if > 0
static size_t m_countInit;
- wxSocketBase* Accept(bool wait = TRUE);
- bool AcceptWith(wxSocketBase& socket, bool wait = TRUE);
+ wxSocketBase* Accept(bool wait = true);
+ bool AcceptWith(wxSocketBase& socket, bool wait = true);
- virtual bool Connect(wxSockAddress& addr, bool wait = TRUE);
+ virtual bool Connect(wxSockAddress& addr, bool wait = true);
+ bool Connect(wxSockAddress& addr, wxSockAddress& local, bool wait = true);
- DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, -1, \
- (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSocketEventFunction, & func ), \
- (wxObject *) NULL ),
+ wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func))