-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstclient.h
37 lines (29 loc) · 1 KB
/
stclient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include <wx/socket.h>
#include <wx/string.h>
#include <wx/event.h>
class stClient : public wxEvtHandler
{
public:
stClient(unsigned int nServerPort, unsigned int nWritePort);
~stClient();
bool StartServer();
bool SendMessageToSourceTrail(const wxString& sMessage);
void SendLocation();
private:
void OnSocketEvent(wxSocketEvent& event);
void OnServerSocketEvent(wxSocketEvent& event);
void HandleMessages(const wxString& sBuffer);
void DecodeMessage(wxString sMessage);
void MoveCursor(const wxString& sFile, unsigned long nLine, unsigned long nCol);
void SendPing();
wxSocketServer* m_pServer;
bool m_bConnected;
wxString m_sMessageBuffer;
unsigned int m_nServerPort;
unsigned int m_nWritePort;
static const wxString MSG_END;
static const wxString MSG_PING;
static const wxString MSG_CURSOR;
static const wxString MSG_CREATE_CDB;
};