src/components/ipc.cpp
/**
 * Called once the end of the message arrives.
 */
Called once the end of the message arrives.
Called once the end of the message arrives .
void ipc::receive_eof() {
  if (m_buffer.empty()) {
    return;
  }
  string payload{string_util::trim(std::move(m_buffer), '\n')};
  m_buffer = std::string();
  if (payload.find(ipc_command_prefix) == 0) {
    m_sig.emit(signals::ipc::command{payload.substr(strlen(ipc_command_prefix))});
  } else if (payload.find(ipc_hook_prefix) == 0) {
    m_sig.emit(signals::ipc::hook{payload.substr(strlen(ipc_hook_prefix))});
  } else if (payload.find(ipc_action_prefix) == 0) {
    m_sig.emit(signals::ipc::action{payload.substr(strlen(ipc_action_prefix))});
  } else {
    m_log.warn("Received unknown ipc message: (payload=%s)", payload);
  }
}
void ipc :: receive_eof ( ) { if ( m_buffer . empty ( ) ) { return ; } string payload { string_util :: trim ( std :: move ( m_buffer ) , ' \n ' ) } ; m_buffer = std :: string ( ) ; if ( payload . find ( ipc_command_prefix ) == 0 ) { m_sig . emit ( signals :: ipc :: command { payload . substr ( strlen ( ipc_command_prefix ) ) } ) ; } else if ( payload . find ( ipc_hook_prefix ) == 0 ) { m_sig . emit ( signals :: ipc :: hook { payload . substr ( strlen ( ipc_hook_prefix ) ) } ) ; } else if ( payload . find ( ipc_action_prefix ) == 0 ) { m_sig . emit ( signals :: ipc :: action { payload . substr ( strlen ( ipc_action_prefix ) ) } ) ; } else { m_log . warn ( " " , payload ) ; } }
Called once the end of the message arrives.
Called once the end of the message arrives .