Major update:

- Rename Function LocalIO -> Channel (Parameters & Methods)
This commit is contained in:
Charl Wentzel
2016-08-23 13:19:43 +02:00
parent 5ea05d119e
commit 7564e6a288
6 changed files with 146 additions and 147 deletions

View File

@@ -60,7 +60,7 @@ CSelectableCore::~CSelectableCore()
}
//---------------------------------------------------------------------------
THandle * CSelectableCore::CreateHandle( const char * HandleName, bool CreateLocalIO )
THandle * CSelectableCore::CreateHandle( const char * HandleName, bool CreateChannel )
{
THandle ** Handle = NULL;
@@ -88,9 +88,9 @@ THandle * CSelectableCore::CreateHandle( const char * HandleName, bool CreateLo
if (Log) Log->Message( DebugLevel, dlMedium, "%s: Handle '%s' - Created", Name, HandleName );
}
// Create Matching IO point
if (CreateLocalIO) {
(*Handle)->LocalIO = AddLocalIO( HandleName );
// Create Matching Channel
if (CreateChannel) {
(*Handle)->Channel = AddChannel( HandleName );
}
return *Handle;
@@ -1037,9 +1037,9 @@ bool CSelectableCore::ProcessBuffer( THandle * Handle, bool Force )
// Write buffer to Outputs
if (Handle->Type == ctRemoteClient) {
Output( Handle->Parent->LocalIO, Data, Len );
Output( Handle->Parent->Channel, Data, Len );
} else {
Output( Handle->LocalIO, Data, Len );
Output( Handle->Channel, Data, Len );
}
// Clear processed bytes from buffer
@@ -1056,9 +1056,9 @@ bool CSelectableCore::ProcessBuffer( THandle * Handle, bool Force )
// Write buffer to Outputs
if (Handle->Type == ctRemoteClient) {
Output( Handle->Parent->LocalIO, Data, Len );
Output( Handle->Parent->Channel, Data, Len );
} else {
Output( Handle->LocalIO, Data, Len );
Output( Handle->Channel, Data, Len );
}
// Clear processed bytes from buffer
@@ -1127,14 +1127,14 @@ int CSelectableCore::WriteToFD( int FD, const char * Data, int Len, bool Force )
}
//---------------------------------------------------------------------------
int CSelectableCore::Input( const char * IOName, const char * Data, int Len )
int CSelectableCore::Input( const char * ChannelName, const char * Data, int Len )
{
THandle * Handle = NULL;
THandle * ChildHandle = NULL;
int BytesWritten = 0;
// Validate
if (!IOName || !Data) {
if (!ChannelName || !Data) {
return 0;
}
else if (Len == -1) {
@@ -1142,22 +1142,22 @@ int CSelectableCore::Input( const char * IOName, const char * Data, int Len )
}
// Get File handle
if (!(Handle = GetHandle( IOName )))
if (!(Handle = GetHandle( ChannelName )))
{
// Log event
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Local IO '%s' - Input rejected, Input not found", Name, IOName );
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Channel '%s' - Input rejected, Input not found", Name, ChannelName );
return 0;
}
// Check that handle is open
else if (Handle->State != csOpen)
{
// Log event
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Local IO '%s' - Input rejected, Handle not Open", Name, IOName );
if (Log) Log->Message( DebugLevel, dlHigh, "%s: Channel '%s' - Input rejected, Handle not Open", Name, ChannelName );
return 0;
}
// Log event
if (Log) Log->Output( DebugLevel, dlHigh, OutputDisplay, Data, Len, "%s: Local IO '%s' - IN:", Name, IOName );
if (Log) Log->Output( DebugLevel, dlHigh, OutputDisplay, Data, Len, "%s: Channel '%s' - IN:", Name, ChannelName );
if (Handle->Type == ctServer)
{