wake server if packet is received
This commit is contained in:
parent
f981fd466a
commit
3615d9e0b7
2 changed files with 11 additions and 10 deletions
|
@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
AC_PREREQ(2.50)
|
||||
AC_INIT(src/main.cpp)
|
||||
|
||||
AM_INIT_AUTOMAKE(llcon,0.9.2cvs)
|
||||
AM_INIT_AUTOMAKE(llcon,0.9.3cvs)
|
||||
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
|
|
@ -47,6 +47,8 @@ void CServer::Start ()
|
|||
|
||||
/* init time for response time evaluation */
|
||||
TimeLastBlock = QTime::currentTime ();
|
||||
|
||||
qDebug("Server started");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,13 +100,11 @@ void CServer::OnTimer ()
|
|||
}
|
||||
else
|
||||
{
|
||||
/* disable server */
|
||||
|
||||
// TODO not yet working since the socket does not have access to the server
|
||||
// object and cannot restart the server if packets arrive...
|
||||
|
||||
// Stop ();
|
||||
// Disable server if no clients are connected. In this case the server
|
||||
// does not consume any significant CPU when no client is connected.
|
||||
Stop ();
|
||||
|
||||
qDebug("Server stopped");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,9 +165,10 @@ void CServer::customEvent(QCustomEvent* Event)
|
|||
switch(iMessType)
|
||||
{
|
||||
case MS_PACKET_RECEIVED:
|
||||
|
||||
printf("packet received\n");
|
||||
|
||||
// wake up the server if a packet was received
|
||||
// if the server is still running, the call to Start() will have
|
||||
// no effect
|
||||
Start ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue