Important Update:
- DeviceCore:
- Added PollCycle variable (not used here)
- WatchdogCore:
- Return "true" on in Process()
- SelectableCore:
- Minor update (code compacted)
- Application/Function:
- Added CApplication as friend of CFunction
- Added param WaitToTerminate on Function
- Application Run() only exists if all (WaitToTerminate) functions
has terminated cleanly.
This commit is contained in:
@@ -2564,20 +2564,18 @@ bool CSelectableCore::Process()
|
||||
{
|
||||
THandle * Handle = NULL;
|
||||
|
||||
// Check all handles
|
||||
// Process all Handles
|
||||
Handle = FirstHandle;
|
||||
while (Handle)
|
||||
{
|
||||
// Auto manage handles
|
||||
if ((Handle->State == csOpenRequest))
|
||||
{
|
||||
if ((Handle->State == csOpenRequest)) {
|
||||
// Resolve then open socket
|
||||
if (Timeout( Handle->LastAction, Handle->ResolveDelay )) {
|
||||
Open( Handle, false );
|
||||
}
|
||||
}
|
||||
else if (((Handle->State != csOpen) && Handle->AutoManage && Handle->Persistent) )
|
||||
{
|
||||
else if (((Handle->State != csOpen) && Handle->AutoManage && Handle->Persistent) ) {
|
||||
// Try to re-open port after delay
|
||||
if (Timeout( Handle->LastAction, Handle->ReopenDelay )) {
|
||||
Open( Handle, false );
|
||||
@@ -2585,11 +2583,9 @@ bool CSelectableCore::Process()
|
||||
}
|
||||
|
||||
// Check Input buffers
|
||||
if (Handle->InBuffer && (Handle->InBuffer->Len() > 0))
|
||||
{
|
||||
if (Handle->InBuffer && (Handle->InBuffer->Len() > 0)) {
|
||||
// Check duration since last PortIn
|
||||
if (Timeout( Handle->InStart, Handle->InTimeout ))
|
||||
{
|
||||
if (Timeout( Handle->InStart, Handle->InTimeout )) {
|
||||
// Process Input
|
||||
ProcessInputBuffer( Handle, true );
|
||||
|
||||
@@ -2599,14 +2595,12 @@ bool CSelectableCore::Process()
|
||||
}
|
||||
|
||||
// Check for auto close (but not on servers)
|
||||
if ((Handle->State == csOpen) && (Handle->Type != ctTCPserver) && (Handle->Type != ctUNIXserver) && Handle->AutoManage && !Handle->Persistent)
|
||||
{
|
||||
if ((Handle->State == csOpen) && Handle->AutoManage && !Handle->Persistent && (Handle->Type != ctTCPserver) && (Handle->Type != ctUNIXserver)) {
|
||||
// Close port after timeout
|
||||
if (Timeout( Handle->LastAction, Handle->CloseTimeout )) {
|
||||
Close( Handle, true );
|
||||
}
|
||||
}
|
||||
|
||||
Handle = Handle->Next;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user