diff options
Diffstat (limited to 'servers/fpga_server_lin/src')
-rw-r--r-- | servers/fpga_server_lin/src/fpga_conn.cpp | 19 | ||||
-rw-r--r-- | servers/fpga_server_lin/src/fpga_conn.h | 1 |
2 files changed, 11 insertions, 9 deletions
diff --git a/servers/fpga_server_lin/src/fpga_conn.cpp b/servers/fpga_server_lin/src/fpga_conn.cpp index ddd430a..4c6f65e 100644 --- a/servers/fpga_server_lin/src/fpga_conn.cpp +++ b/servers/fpga_server_lin/src/fpga_conn.cpp @@ -41,10 +41,6 @@ #include "fpga_conn.h" #define ABORT_SOCKET(s) s->close(); \ - tqApp->processEvents(); \ - while (s->state() == TQSocket::Closing) { \ - tqApp->processEvents(); \ - } \ s->disconnect(); \ delete s; \ s = NULL; @@ -153,13 +149,13 @@ int FPGASocket::setupSerial() { return 0; } -int FPGASocket::enterCommandLoop() { +void FPGASocket::commandLoop() { int cc; char buffer[10000]; m_criticalSection++; try { - while (state() == TQSocket::Connected) { + if (state() == TQSocket::Connected) { cc = read(m_fd_tty, buffer, 10000); if (cc > 0) { writeBlock(buffer, cc); @@ -175,16 +171,21 @@ int FPGASocket::enterCommandLoop() { } } } - m_criticalSection--; - return 0; + TQTimer::singleShot(0, this, SLOT(commandLoop())); + return; } catch (...) { m_criticalSection--; - return -1; + return; } } +int FPGASocket::enterCommandLoop() { + TQTimer::singleShot(0, this, SLOT(commandLoop())); + return 0; +} + /* The FPGAServer class handles new connections to the server. For every client that connects, it creates a new FPGASocket -- that instance is now diff --git a/servers/fpga_server_lin/src/fpga_conn.h b/servers/fpga_server_lin/src/fpga_conn.h index be11de7..8c99794 100644 --- a/servers/fpga_server_lin/src/fpga_conn.h +++ b/servers/fpga_server_lin/src/fpga_conn.h @@ -54,6 +54,7 @@ class FPGASocket : public TDEKerberosServerSocket private slots: void connectionClosedHandler(); int setupSerial(); + void commandLoop(); private: int line; |