28 lines
473 B
C++
28 lines
473 B
C++
#ifndef SERVER_CORE_H
|
|
#define SERVER_CORE_H
|
|
|
|
#include <memory>
|
|
#include <wx/wx.h>
|
|
#include <wx/socket.h>
|
|
#include <wx/event.h>
|
|
#include <wx/evtloop.h>
|
|
|
|
class CServerCore : public wxEvtHandler
|
|
{
|
|
public:
|
|
CServerCore();
|
|
~CServerCore();
|
|
|
|
public:
|
|
bool Init(const wxString& ip, unsigned short port);
|
|
int Run();
|
|
|
|
private:
|
|
void OnServerEvent(wxSocketEvent& event);
|
|
|
|
private:
|
|
std::unique_ptr<wxSocketServer> server_{};
|
|
wxWindowID server_id_{};
|
|
};
|
|
|
|
#endif |