projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Compilation fix for VC++ 5 and 6
[wxWidgets.git]
/
include
/
wx
/
socket.h
diff --git
a/include/wx/socket.h
b/include/wx/socket.h
index ee5df5f03ed55b02ee32e5da168cb786cfc24102..15a718b4fd90a1b1fa395f7cb5e653fdeec5a857 100644
(file)
--- a/
include/wx/socket.h
+++ b/
include/wx/socket.h
@@
-9,8
+9,8
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_
NETWORK_SOCKET_H
-#define _WX_
NETWORK_SOCKET_H
+#ifndef _WX_
SOCKET_H_
+#define _WX_
SOCKET_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "socket.h"
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "socket.h"
@@
-24,13
+24,7
@@
// wxSocket headers
// ---------------------------------------------------------------------------
// wxSocket headers
// ---------------------------------------------------------------------------
-#ifdef WXPREC
- #include "wx/wxprec.h"
-#else
- #include "wx/event.h"
- #include "wx/string.h"
-#endif
-
+#include "wx/event.h"
#include "wx/sckaddr.h"
#include "wx/gsocket.h"
#include "wx/list.h"
#include "wx/sckaddr.h"
#include "wx/gsocket.h"
#include "wx/list.h"
@@
-80,7
+74,8
@@
enum
wxSOCKET_NONE = 0,
wxSOCKET_NOWAIT = 1,
wxSOCKET_WAITALL = 2,
wxSOCKET_NONE = 0,
wxSOCKET_NOWAIT = 1,
wxSOCKET_WAITALL = 2,
- wxSOCKET_BLOCK = 4
+ wxSOCKET_BLOCK = 4,
+ wxSOCKET_REUSEADDR = 8
};
enum wxSocketType
};
enum wxSocketType
@@
-123,7
+118,7
@@
public:
inline bool IsData() { return WaitForRead(0, 0); };
inline bool IsDisconnected() const { return !IsConnected(); };
inline wxUint32 LastCount() const { return m_lcount; }
inline bool IsData() { return WaitForRead(0, 0); };
inline bool IsDisconnected() const { return !IsConnected(); };
inline wxUint32 LastCount() const { return m_lcount; }
- inline wxSocketError LastError() const { return (wxSocketError)
GSocket_GetError(m_socket
); }
+ inline wxSocketError LastError() const { return (wxSocketError)
m_socket->GetError(
); }
void SaveState();
void RestoreState();
void SaveState();
void RestoreState();
@@
-141,7
+136,7
@@
public:
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);
- void InterruptWait() { m_interrupt =
TRUE
; };
+ void InterruptWait() { m_interrupt =
true
; };
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);
@@
-151,10
+146,14
@@
public:
void SetFlags(wxSocketFlags flags);
void SetTimeout(long seconds);
void SetFlags(wxSocketFlags flags);
void SetTimeout(long seconds);
+ bool GetOption(int level, int optname, void *optval, int *optlen);
+ bool SetOption(int level, int optname, const void *optval, int optlen);
+ inline wxUint32 GetLastIOSize() const { return m_lcount; };
+
// 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; }
- void SetEventHandler(wxEvtHandler& handler, int id =
-1
);
+ void SetEventHandler(wxEvtHandler& handler, int id =
wxID_ANY
);
void SetNotify(wxSocketEventFlags flags);
void Notify(bool notify);
void SetNotify(wxSocketEventFlags flags);
void Notify(bool notify);
@@
-237,8
+236,8
@@
class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase
public:
wxSocketServer(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE);
public:
wxSocketServer(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE);
- wxSocketBase* Accept(bool wait =
TRUE
);
- bool AcceptWith(wxSocketBase& socket, bool wait =
TRUE
);
+ wxSocketBase* Accept(bool wait =
true
);
+ bool AcceptWith(wxSocketBase& socket, bool wait =
true
);
bool WaitForAccept(long seconds = -1, long milliseconds = 0);
bool WaitForAccept(long seconds = -1, long milliseconds = 0);
@@
-258,7
+257,7
@@
public:
wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE);
virtual ~wxSocketClient();
wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE);
virtual ~wxSocketClient();
- virtual bool Connect(wxSockAddress& addr, bool wait =
TRUE
);
+ virtual bool Connect(wxSockAddress& addr, bool wait =
true
);
bool WaitOnConnect(long seconds = -1, long milliseconds = 0);
bool WaitOnConnect(long seconds = -1, long milliseconds = 0);
@@
-321,16
+320,13
@@
public:
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
+#define wxSocketEventHandler(func) \
+ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func)
+
#define EVT_SOCKET(id, func) \
#define EVT_SOCKET(id, func) \
- DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, -1, \
- (wxObjectEventFunction) \
- (wxEventFunction) \
- (wxSocketEventFunction) & func, \
- (wxObject *) NULL ),
+ wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func))
+#endif // wxUSE_SOCKETS
-#endif
- // wxUSE_SOCKETS
+#endif // _WX_SOCKET_H_
-#endif
- // _WX_NETWORK_SOCKET_H