From: John L. <jr...@us...> - 2006-10-04 05:55:09
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10846/wxLua/modules/wxluasocket/include Modified Files: dservice.h wxldserv.h Log Message: add wxSocket implementation for wxLuaSockets... ifdefed off since it seems very slow and doesn't always connect Index: wxldserv.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/wxldserv.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wxldserv.h 3 Oct 2006 19:52:16 -0000 1.20 --- wxldserv.h 4 Oct 2006 05:55:02 -0000 1.21 *************** *** 22,26 **** class WXDLLIMPEXP_WXLUASOCKET wxLuaDebuggerBase; - class WXDLLIMPEXP_WXLUASOCKET wxLuaDebuggerServer; class WXDLLIMPEXP_WXLUASOCKET wxLuaDebuggerEvent; class WXDLLIMPEXP_WXLUADEBUG wxLuaStackDialog; --- 22,25 ---- *************** *** 175,178 **** --- 174,180 ---- virtual wxLuaSocketBase* GetSocketBase() = 0; + // Send the event to this wxEvtHandler + virtual void SendEvent(wxEvent& event) { AddPendingEvent(event); } + // Get/Set the wxLuaStackDialog to show the stack of the debugged program wxLuaStackDialog* GetStackDialog() { return m_stackDialog; } *************** *** 216,219 **** --- 218,224 ---- }; + #define WXLUASOCKET_USE_C_SOCKET + #ifdef WXLUASOCKET_USE_C_SOCKET + // ---------------------------------------------------------------------------- // wxLuaDebuggerServer - a socket server for a lua program to communicate with a *************** *** 264,267 **** --- 269,313 ---- }; + #else // !WXLUASOCKET_USE_C_SOCKET + + // ---------------------------------------------------------------------------- + // wxLuaDebuggerwxServer - a socket server for a lua program to communicate with a + // wxLuaDebugTarget run in C++. + // ---------------------------------------------------------------------------- + class WXDLLIMPEXP_WXLUASOCKET wxLuaDebugSocket; + #include "wxluasocket/include/dservice.h" + + class WXDLLIMPEXP_WXLUASOCKET wxLuaDebuggerwxSocketServer : public wxLuaDebuggerBase + { + public: + wxLuaDebuggerwxSocketServer(int portNumber); + virtual ~wxLuaDebuggerwxSocketServer(); + + bool StartServer(); + bool StopServer(); + bool StartClient(); + bool StartServerThread() { return true; } + + virtual wxLuaSocketBase* GetSocketBase() { return m_acceptedSocket; } + + virtual void SendEvent(wxEvent& event) { ProcessEvent(event); } + + void OnServerEvent(wxSocketEvent& event); + void OnSocketEvent(wxSocketEvent& event); + + protected: + wxSocketServer *m_serverSocket; + wxLuaDebugSocket *m_acceptedSocket; + int m_portNumber; + + private: + DECLARE_EVENT_TABLE(); + DECLARE_ABSTRACT_CLASS(wxLuaDebuggerwxSocketServer) + }; + + typedef wxLuaDebuggerwxSocketServer wxLuaDebuggerServer; + + #endif // WXLUASOCKET_USE_C_SOCKET + // ---------------------------------------------------------------------------- // wxLuaDebuggerEvent Index: dservice.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/include/dservice.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dservice.h 3 Oct 2006 05:12:45 -0000 1.18 --- dservice.h 4 Oct 2006 05:55:02 -0000 1.19 *************** *** 28,32 **** #include "wxlua/include/wxlua.h" - #include "wxluasocket/include/wxldserv.h" #include "wxluasocket/include/wxlsock.h" --- 28,31 ---- *************** *** 47,68 **** { public: - wxLuaDebugSocket(const wxLuaDebugSocket& debugSocket) : m_socket(debugSocket.m_socket) {} - wxLuaDebugSocket(wxSocketBase* sock) : m_socket(sock) {} wxLuaDebugSocket() : m_socket(NULL) {} virtual ~wxLuaDebugSocket() { Destroy(); } ! // Safely Destroy Socket ! bool Destroy() ! { ! if (m_socket) ! { ! wxSocketBase* sock = m_socket; ! m_socket = NULL; ! return sock->Destroy(); ! } ! ! return true; ! } // Get/Set the socket, if you set a new socket you must delete the --- 46,56 ---- { public: wxLuaDebugSocket() : m_socket(NULL) {} + wxLuaDebugSocket(wxSocketBase* sock) : m_socket(sock) {} virtual ~wxLuaDebugSocket() { Destroy(); } ! // Safely close and destroy the socket ! bool Destroy(); // Get/Set the socket, if you set a new socket you must delete the *************** *** 82,91 **** virtual int Write(const char *buffer, wxUint32 length); - // operators - bool operator==(wxLuaDebugSocket& debugSocket) - { - return debugSocket.m_socket == m_socket; - } - protected: wxSocketBase* m_socket; --- 70,73 ---- *************** *** 94,97 **** --- 76,81 ---- WX_DECLARE_USER_EXPORTED_LIST(wxLuaDebugSocket, wxLuaDebugSocketList, WXDLLIMPEXP_WXLUASOCKET); + #include "wxluasocket/include/wxldserv.h" + // ---------------------------------------------------------------------------- // wxLuaBreakPoint - Project BreakPoint - a filename/line pair *************** *** 258,262 **** void OnServerEvent(wxSocketEvent& event); void OnSocketEvent(wxSocketEvent& event); - void OnSocketLostEvent(wxSocketEvent& event); wxLuaDebugSocket* GetDebugSocket(wxSocketBase* sock); --- 242,245 ---- |