Add wxSocketBase::GetSocket().
Provide direct access to the underlying socket descriptor. Closes #8829. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73837 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -79,10 +79,6 @@
|
||||
|
||||
// define some symbols which winsock.h defines but traditional BSD headers
|
||||
// don't
|
||||
#ifndef __WINDOWS__
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
||||
#ifndef INVALID_SOCKET
|
||||
#define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
@@ -293,7 +289,7 @@ public:
|
||||
// TODO: make these fields protected and provide accessors for those of
|
||||
// them that wxSocketBase really needs
|
||||
//protected:
|
||||
SOCKET m_fd;
|
||||
wxSOCKET_T m_fd;
|
||||
|
||||
int m_initialRecvBufferSize;
|
||||
int m_initialSendBufferSize;
|
||||
|
@@ -30,6 +30,16 @@ class wxSocketImpl;
|
||||
// Types and constants
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// Define the type of native sockets.
|
||||
#if defined(__WINDOWS__)
|
||||
// Although socket descriptors are still 32 bit values, even under Win64,
|
||||
// the socket type is 64 bit there.
|
||||
typedef wxUIntPtr wxSOCKET_T;
|
||||
#else
|
||||
typedef int wxSOCKET_T;
|
||||
#endif
|
||||
|
||||
|
||||
// Types of different socket notifications or events.
|
||||
//
|
||||
// NB: the values here should be consecutive and start with 0 as they are
|
||||
@@ -187,6 +197,9 @@ public:
|
||||
void SetNotify(wxSocketEventFlags flags);
|
||||
void Notify(bool notify);
|
||||
|
||||
// Get the underlying socket descriptor.
|
||||
wxSOCKET_T GetSocket() const;
|
||||
|
||||
// initialize/shutdown the sockets (done automatically so there is no need
|
||||
// to call these functions usually)
|
||||
//
|
||||
|
Reference in New Issue
Block a user