/* Function called on every client request. */ void EDA_DRAW_FRAME::OnSockRequest( wxSocketEvent& evt ) { size_t len; wxSocketBase* sock = evt.GetSocket(); switch( evt.GetSocketEvent() ) { case wxSOCKET_INPUT: sock->Read( client_ipc_buffer, 1 ); if( sock->LastCount() == 0 ) break; // No data, occurs on opening connection sock->Read( client_ipc_buffer + 1, IPC_BUF_SIZE - 2 ); len = 1 + sock->LastCount(); client_ipc_buffer[len] = 0; ExecuteRemoteCommand( client_ipc_buffer ); break; case wxSOCKET_LOST: return; break; default: wxPrintf( wxT( "EDA_DRAW_FRAME::OnSockRequest() error: Invalid event !" ) ); break; } }
////////////////////////////////////////////////////////////////////////////// /// public ExecuteCommand /// This starts a command, and waits until it has come to completion. /// Extremely simple: if isRemote is true, it calls ExecuteRemoteCommand, /// otherwise, it calls ExecuteLocalCommand. /// /// @param isRemote bool Whether this is to be executed remotely. /// @param cmd wxString What command to execute. /// /// @return wxString The resulting output /// /// @author David Czechowski @date 04-22-2004 ////////////////////////////////////////////////////////////////////////////// wxString Networking::ExecuteCommand(bool isRemote, wxString cmd) { if(isRemote) { return ExecuteRemoteCommand(cmd); } else { return ExecuteLocalCommand(cmd); } }
void CxDlgUserMod::OnOK() { CString csCommandLine; GenerateUsermodSyntax(csCommandLine); ExecuteRemoteCommand(csCommandLine); CDialog::OnOK(); }