34 lines
637 B
C++
34 lines
637 B
C++
#ifndef CLIENTCORE_H
|
|
#define CLIENTCORE_H
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <wx/socket.h>
|
|
|
|
class ClientCore : public wxEvtHandler
|
|
{
|
|
public:
|
|
ClientCore();
|
|
|
|
public:
|
|
bool Connect(const wxString& host, uint16_t port);
|
|
void Disconnect();
|
|
|
|
public:
|
|
bool GetOnlineList(std::vector<wxString>& list);
|
|
bool AskDirectory(const wxString& id, const wxString& path);
|
|
|
|
private:
|
|
void OnSocketEvent(wxSocketEvent& event);
|
|
|
|
private:
|
|
void HeartBeat();
|
|
|
|
private:
|
|
wxString id_;
|
|
std::shared_ptr<wxSocketClient> socket_;
|
|
std::shared_ptr<wxThread> heartsThread_;
|
|
};
|
|
|
|
#endif // CLIENTCORE_H
|