Skip to content
Snippets Groups Projects
Commit c336551e authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

exit simulator in stepping mode if EKF on control socket

parent 9a683007
No related branches found
No related tags found
No related merge requests found
......@@ -277,15 +277,15 @@ string FGfdmSocket::Receive(void)
return data;
}
void FGfdmSocket::Wait(void)
bool FGfdmSocket::Wait(void)
{
fd_set fds;
if (sckt_in <= 0) {
return;
return false;
}
FD_ZERO(&fds);
FD_SET(sckt_in, &fds);
select(sckt_in+1, &fds, NULL, NULL, NULL);
return select(sckt_in+1, &fds, NULL, NULL, NULL) == 1;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......
......@@ -106,7 +106,7 @@ public:
void Clear(const std::string& s);
void Close(void);
bool GetConnectStatus(void) {return connected;}
void Wait(void);
bool Wait(void);
enum {ptUDP, ptTCP};
......
......@@ -48,6 +48,7 @@ INCLUDES
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <unistd.h>
using namespace std;
......@@ -225,7 +226,7 @@ bool FGInput::Run(void)
RunPostFunctions();
return false;
return data.size() > 0;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -306,8 +307,11 @@ void FGInput::Debug(int from)
// wait for new input and process it
void FGInput::Wait(void)
{
socket->Wait();
Run();
if (socket->Wait()) {
if (!Run()) {
exit(0);
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment