Important Update:
- Channels (FunctionCore & SelectableBare): - Added state "Standby", allow auto-managed handle to be opened - SelectableCore: - Set default "Persistent" state for sockets based on type - Remove Process() method (no different from SelectableBare - DateTimeCore: - Added BuildDateTimeStr() methods to build date for values - JSONparseCore: - Added error message to file operations
This commit is contained in:
@@ -175,7 +175,7 @@ bool CSelectableBare::HandleState( THandle * Handle, EConnectState State )
|
||||
if (!Handle || (Handle->State == State))
|
||||
return false;
|
||||
|
||||
// Set Call back
|
||||
// Execute call back for state
|
||||
if (Handle->StateCallback[ (int)State ])
|
||||
(Handle->StateCallback[ (int)State ])( this, Handle, State );
|
||||
|
||||
@@ -188,6 +188,8 @@ bool CSelectableBare::HandleState( THandle * Handle, EConnectState State )
|
||||
ChannelState = CH_wait;
|
||||
else if ((Handle->State == csOpen) || (Handle->State == csDataWaiting))
|
||||
ChannelState = CH_ready;
|
||||
else if (Handle->AutoManage)
|
||||
ChannelState = CH_standby;
|
||||
else
|
||||
ChannelState = CH_off;
|
||||
if (Handle->Channel->InState != ChannelState)
|
||||
@@ -677,9 +679,9 @@ int CSelectableBare::Input( const char * ChannelName, const char * SourceRef, co
|
||||
ProcessName, Name, ((SourceRef && *SourceRef)? SourceRef : "(Any)"), ChannelName );
|
||||
return 0;
|
||||
}
|
||||
else if (Channel->InState != CH_ready) {
|
||||
else if (Channel->InState == CH_off) {
|
||||
// Channel disabled
|
||||
if (Log) Log->Message( LogLevel, dlHigh, "%s/%s: Channel '%s'->'%s' - Input rejected, Channel not Ready",
|
||||
if (Log) Log->Message( LogLevel, dlHigh, "%s/%s: Channel '%s'->'%s' - Input rejected, Channel off",
|
||||
ProcessName, Name, ((SourceRef && *SourceRef)? SourceRef : "(Any)"), ChannelName );
|
||||
return 0;
|
||||
}
|
||||
@@ -822,6 +824,10 @@ bool CSelectableBare::Process()
|
||||
Open( Handle );
|
||||
}
|
||||
}
|
||||
else if (Handle->Channel && (Handle->Channel->InState == CH_off) && Handle->AutoManage) {
|
||||
// Set channel to standby
|
||||
SetChannelInState( Handle->Channel, CH_standby );
|
||||
}
|
||||
|
||||
// Check Input buffers
|
||||
if (Handle->InBuffer && (Handle->InBuffer->Len() > 0)) {
|
||||
|
||||
Reference in New Issue
Block a user