23 #include "wxgis/net/message.h"
24 #include "wxgis/core/pointer.h"
26 #include "wx/thread.h"
27 #include "wx/socket.h"
31 #define BUFF_SIZE 16384
46 virtual void *Entry();
47 virtual void OnExit();
62 virtual void *Entry();
63 virtual void OnExit();
84 virtual bool Connect(
void){
return false;};
85 virtual bool Disconnect(
void){
return false;};
86 virtual bool IsConnected(
void){
return m_bIsConnected;};
87 virtual void SendNetMessageAsync(
const wxNetMessage & msg);
89 typedef std::priority_queue< wxNetMessage, std::deque<wxNetMessage> > WXGISMSGQUEUE;
90 virtual int GetId(
void)
const {
return m_nUserId;};
91 virtual void SetId(
const int nUserId){m_nUserId = nUserId;};
93 bool CreateAndRunThreads(
void);
94 void DestroyThreads(
void);
95 virtual bool ProcessOutputNetMessage(
void);
96 virtual bool ProcessInputNetMessage(
void);
98 WXGISMSGQUEUE m_aoMessages;
100 wxCriticalSection m_dataCS;
101 wxCriticalSection m_msgCS;
102 bool m_bIsConnected, m_bIsConnecting;
103 wxSocketBase* m_pSock;
106 wxVector<wxNetMessage> m_oaSyncMessages;
107 wxArrayLong m_laWaitIds;
108 char m_Buffer[BUFF_SIZE];
111 bool WXDLLIMPEXP_GIS_NET SendUDP(IPaddress addr,
wxNetMessage & msg,
bool broadcast);
112 wxString WXDLLIMPEXP_GIS_NET GetSocketErrorMsg(
int pSockError);