diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-01 20:43:39 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-01 20:43:39 -0500 |
commit | 963501ff41849e6bbcaa7a5c12c6e04b37a8a130 (patch) | |
tree | a92d85facc6b5168890d78e9ad8944fd96d5507a /servers/fpga_server_lin/src | |
parent | e9dafbb9d016a1aa5e90bb12c63c12b8521cf059 (diff) | |
download | ulab-963501ff41849e6bbcaa7a5c12c6e04b37a8a130.tar.gz ulab-963501ff41849e6bbcaa7a5c12c6e04b37a8a130.zip |
Fix crashes in servers
Start work on FPGA client
Diffstat (limited to 'servers/fpga_server_lin/src')
-rw-r--r-- | servers/fpga_server_lin/src/fpga_conn.cpp | 16 | ||||
-rw-r--r-- | servers/fpga_server_lin/src/fpga_conn.h | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/servers/fpga_server_lin/src/fpga_conn.cpp b/servers/fpga_server_lin/src/fpga_conn.cpp index f0ab39d..6f4cecf 100644 --- a/servers/fpga_server_lin/src/fpga_conn.cpp +++ b/servers/fpga_server_lin/src/fpga_conn.cpp @@ -57,7 +57,7 @@ struct exit_exception { instance of this class. */ FPGASocket::FPGASocket(int sock, TQObject *parent, const char *name) : - TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_config(static_cast<FPGAServer*>(parent)->m_config) { + TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_loopTimer(NULL), m_config(static_cast<FPGAServer*>(parent)->m_config) { setServiceName("remotefpga"); @@ -68,7 +68,11 @@ FPGASocket::FPGASocket(int sock, TQObject *parent, const char *name) : } FPGASocket::~FPGASocket() { - // + if (m_loopTimer) { + m_loopTimer->stop(); + delete m_loopTimer; + m_loopTimer = NULL; + } } void FPGASocket::close() { @@ -177,7 +181,7 @@ void FPGASocket::commandLoop() { } } m_criticalSection--; - TQTimer::singleShot(0, this, SLOT(commandLoop())); + if (m_loopTimer) m_loopTimer->start(0, TRUE); return; } catch (...) { @@ -187,7 +191,11 @@ void FPGASocket::commandLoop() { } int FPGASocket::enterCommandLoop() { - TQTimer::singleShot(0, this, SLOT(commandLoop())); + if (!m_loopTimer) { + m_loopTimer = new TQTimer(); + connect(m_loopTimer, SIGNAL(timeout()), this, SLOT(commandLoop())); + } + if (m_loopTimer) m_loopTimer->start(0, TRUE); return 0; } diff --git a/servers/fpga_server_lin/src/fpga_conn.h b/servers/fpga_server_lin/src/fpga_conn.h index 8c99794..717a35b 100644 --- a/servers/fpga_server_lin/src/fpga_conn.h +++ b/servers/fpga_server_lin/src/fpga_conn.h @@ -62,6 +62,8 @@ class FPGASocket : public TDEKerberosServerSocket TQString m_remoteHost; int m_fd_tty; + TQTimer* m_loopTimer; + KSimpleConfig* m_config; friend class FPGAServer; |