Minor updates:
- Rename function ApplicationCore::GetProcessName -> GetFileName - Correct misspelled variable "Persistent" in CSelectableCore::Init - Clear compiler warning: Persistent not initialised
This commit is contained in:
@@ -94,7 +94,7 @@ CApplication::~CApplication()
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void CApplication::GetProcessName( char ** ProcessName, char * pFilePath )
|
||||
void CApplication::GetFileName( char ** ProcessName, char * pFilePath )
|
||||
{
|
||||
char * TempStr;
|
||||
|
||||
@@ -116,7 +116,7 @@ bool CApplication::ReadParam( int argc, char *argv[] )
|
||||
// Read Parameters
|
||||
if ((argc != 2)) {
|
||||
// Get Process Name
|
||||
GetProcessName( &ProcessName, argv[0] );
|
||||
GetFileName( &ProcessName, argv[0] );
|
||||
|
||||
// Incorrect no of parameters, show correct usage
|
||||
printf( "%s: Incorrect number of parameters\n", ProcessName );
|
||||
@@ -125,7 +125,7 @@ bool CApplication::ReadParam( int argc, char *argv[] )
|
||||
}
|
||||
else {
|
||||
// Load parameters
|
||||
GetProcessName( &ProcessName, argv[1] );
|
||||
GetFileName( &ProcessName, argv[1] );
|
||||
ConfigFile = argv[1];
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
// Manage Config File
|
||||
bool ReadParam( int argc, char *argv[] );
|
||||
void GetProcessName( char ** ProcessName, char * pFilePath );
|
||||
void GetFileName( char ** ProcessName, char * pFilePath );
|
||||
bool LoadConfig();
|
||||
bool SaveConfig();
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
short Parity;
|
||||
short FlowCtrl;
|
||||
short Queue;
|
||||
bool Persitent;
|
||||
bool Persistent = false;
|
||||
|
||||
// Call Previous load config
|
||||
if (!CFunctionCore::Init( FunctionConfig ))
|
||||
@@ -162,7 +162,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
SerialConfig->GetChInt( "DataBits", 8, true ),
|
||||
Parity, SerialConfig->GetChInt( "StopBits", 1, true ),
|
||||
FlowCtrl, SerialConfig->GetChInt( "DataWait", 0, true ));
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp( Type, "LinePrinter" )) {
|
||||
@@ -173,7 +173,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
Address = (char*)HandleConfig->GetChStr( "Port/Address", NULL, true ); // Get default value
|
||||
|
||||
SetLinePrinterHandle( Handle, Address );
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
else if (!strcasecmp( Type, "UNIXserver" )) {
|
||||
// Get UNIX socket handle
|
||||
@@ -184,7 +184,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
|
||||
Queue = HandleConfig->GetChInt( "Socket/Queue", 2, true );
|
||||
SetUnixHandle( Handle, ctUNIXserver, Address, Queue );
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
else if (!strcasecmp( Type, "UNIXclient" )) {
|
||||
// Get UNIX socket handle
|
||||
@@ -194,7 +194,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
Address = (char*)HandleConfig->GetChStr( "Socket/Address", NULL, true ); // Get default Address value
|
||||
|
||||
SetUnixHandle( Handle, ctUNIXclient, Address, 0 );
|
||||
Persitent = false;
|
||||
Persistent = false;
|
||||
}
|
||||
else if (!strcasecmp( Type, "UDPserver" )) {
|
||||
// Get UDP address & port
|
||||
@@ -207,7 +207,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
Port = (char*)HandleConfig->GetChStr( "Socket/Port", "0", true ); // Get default Port value
|
||||
}
|
||||
SetSocketHandle( Handle, ctUDPserver, Address, strlcase(Port), 0 );
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
else if (!strcasecmp( Type, "UDPclient" )) {
|
||||
// Get UDP address & port
|
||||
@@ -220,7 +220,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
Port = (char*)HandleConfig->GetChStr( "Socket/Port", "0", true ); // Get default Port value
|
||||
}
|
||||
SetSocketHandle( Handle, ctUDPclient, Address, strlcase(Port), 0 );
|
||||
Persitent = false;
|
||||
Persistent = false;
|
||||
}
|
||||
else if (!strcasecmp( Type, "TCPserver" )) {
|
||||
// Get TCP address & port
|
||||
@@ -234,7 +234,7 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
}
|
||||
Queue = HandleConfig->GetChInt( "Socket/Queue", 2, true );
|
||||
SetSocketHandle( Handle, ctTCPserver, Address, strlcase(Port), Queue );
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
else if (!strcasecmp( Type, "TCPclient" )) {
|
||||
// Get TCP address & port
|
||||
@@ -247,20 +247,20 @@ bool CSelectableCore::Init( CDataMember * FunctionConfig )
|
||||
Port = (char*)HandleConfig->GetChStr( "Socket/Port", "0", true ); // Get default Port value
|
||||
}
|
||||
SetSocketHandle( Handle, ctTCPclient, Address, strlcase(Port), 0 );
|
||||
Persitent = false;
|
||||
Persistent = false;
|
||||
}
|
||||
else if (!strcasecmp( Type, "ForkPipe" )) {
|
||||
// Get fork pipe handle
|
||||
Address = (char*)HandleConfig->GetChStr( "Fork/ExecPath", NULL, true ); // Get default value
|
||||
SetForkPipeHandle( Handle, Address );
|
||||
Persitent = true;
|
||||
Persistent = true;
|
||||
}
|
||||
|
||||
// Set Auto Manage
|
||||
SetAutoManage( Handle, HandleConfig->GetChBool( "AutoManage/Enabled", true, true ),
|
||||
HandleConfig->GetChBool( "AutoManage/Persistent", Persitent, true ),
|
||||
HandleConfig->GetChInt( "AutoManage/ReopenDelay", 2000, true ),
|
||||
HandleConfig->GetChInt( "AutoManage/CloseTimeout", 2000, true ));
|
||||
SetAutoManage( Handle, HandleConfig->GetChBool( "AutoManage/Enabled", true, true ),
|
||||
HandleConfig->GetChBool( "AutoManage/Persistent", Persistent, true ),
|
||||
HandleConfig->GetChInt( "AutoManage/ReopenDelay", 2000, true ),
|
||||
HandleConfig->GetChInt( "AutoManage/CloseTimeout", 2000, true ));
|
||||
|
||||
// Input buffer
|
||||
SetInBuffer( Handle, HandleConfig->GetChInt( "InputBuffer/Size", 0 ),
|
||||
|
||||
Reference in New Issue
Block a user