Added GSocket_Init and GSocket_Cleanup
Added wxSocketModule to socket.cpp to call GSocket_Init and GSocket_Cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -73,6 +73,13 @@ typedef void (*GSocketFallback)(GSocket *socket, GSocketEvent event,
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Global initialisers */
|
||||||
|
|
||||||
|
/* GSocket_Init() must be called at the beginning */
|
||||||
|
void GSocket_Init();
|
||||||
|
/* GSocket_Cleanup() must be called at the ending */
|
||||||
|
void GSocket_Cleanup();
|
||||||
|
|
||||||
/* Constructors / Destructors */
|
/* Constructors / Destructors */
|
||||||
|
|
||||||
GSocket *GSocket_new();
|
GSocket *GSocket_new();
|
||||||
|
@@ -38,7 +38,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef enum {
|
typedef enum {
|
||||||
wxHTTP_GET
|
wxHTTP_GET,
|
||||||
|
wxHTTP_HEAD
|
||||||
} wxHTTP_Req;
|
} wxHTTP_Req;
|
||||||
bool BuildRequest(const wxString& path, wxHTTP_Req req);
|
bool BuildRequest(const wxString& path, wxHTTP_Req req);
|
||||||
void SendHeaders();
|
void SendHeaders();
|
||||||
|
@@ -905,5 +905,22 @@ void wxSocketEvent::CopyObject(wxObject& obj_d) const
|
|||||||
event->m_socket = m_socket;
|
event->m_socket = m_socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
// wxSocketModule
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxSocketModule: public wxModule {
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxSocketModule)
|
||||||
|
public:
|
||||||
|
bool OnInit() {
|
||||||
|
GSocket_Init();
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
void OnExit() {
|
||||||
|
GSocket_Done();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_SOCKETS
|
// wxUSE_SOCKETS
|
||||||
|
@@ -52,6 +52,16 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Global initialisers */
|
||||||
|
|
||||||
|
void GSocket_Init()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GSocket_Cleanup()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Constructors / Destructors */
|
/* Constructors / Destructors */
|
||||||
|
|
||||||
GSocket *GSocket_new()
|
GSocket *GSocket_new()
|
||||||
|
Reference in New Issue
Block a user