|
|
@@ -585,9 +585,15 @@ snfXCITCPChannel* LowestQueue(snfXCITCPChannel* A, snfXCITCPChannel* B) { |
|
|
|
} |
|
|
|
|
|
|
|
snfXCITCPChannel* snfXCImgr::BestAvailableChannel() { // Selects XCI channel w/ lowest queue. |
|
|
|
return LowestQueue( // Pick the lowest of the lowest. |
|
|
|
LowestQueue(C0, C1), |
|
|
|
LowestQueue(C2, C3) |
|
|
|
return LowestQueue( // Pick the lowest of the lowest.
|
|
|
|
LowestQueue( |
|
|
|
LowestQueue(C0, C1), |
|
|
|
LowestQueue(C2, C3)
|
|
|
|
),
|
|
|
|
LowestQueue(
|
|
|
|
LowestQueue(C4, C5), |
|
|
|
LowestQueue(C6, C7)
|
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
@@ -613,10 +619,14 @@ void snfXCImgr::startup_XCI() { |
|
|
|
ScopeMutex IGotIt(ChannelMutex); // Serialize state control for safety. |
|
|
|
if(myHome) { // We need to know our home. |
|
|
|
if(CFG_XCI_ON) { // If XCI is configured on, startup! |
|
|
|
C0 = new snfXCITCPChannel(myHome, "C0"); // Launch our 4 processing channels. |
|
|
|
C0 = new snfXCITCPChannel(myHome, "C0"); // Launch our 8 processing channels. |
|
|
|
C1 = new snfXCITCPChannel(myHome, "C1"); |
|
|
|
C2 = new snfXCITCPChannel(myHome, "C2"); |
|
|
|
C3 = new snfXCITCPChannel(myHome, "C3"); |
|
|
|
C4 = new snfXCITCPChannel(myHome, "C4"); |
|
|
|
C5 = new snfXCITCPChannel(myHome, "C5"); |
|
|
|
C6 = new snfXCITCPChannel(myHome, "C6"); |
|
|
|
C7 = new snfXCITCPChannel(myHome, "C7"); |
|
|
|
startup_Listener(); // Start up our listener. |
|
|
|
myHome->logThisInfo("XCI", 0, "Startup"); // Log the startup. |
|
|
|
XCI_UP = true; // Set the flag. We're up! |
|
|
@@ -632,6 +642,10 @@ void snfXCImgr::shutdown_XCI() { |
|
|
|
if(C1) { delete C1; C1 = 0; } // If up, take C1 down and NULL it. |
|
|
|
if(C2) { delete C2; C2 = 0; } // If up, take C2 down and NULL it. |
|
|
|
if(C3) { delete C3; C3 = 0; } // If up, take C3 down and NULL it. |
|
|
|
if(C4) { delete C4; C4 = 0; } // If up, take C4 down and NULL it. |
|
|
|
if(C5) { delete C5; C5 = 0; } // If up, take C5 down and NULL it. |
|
|
|
if(C6) { delete C6; C6 = 0; } // If up, take C6 down and NULL it. |
|
|
|
if(C7) { delete C7; C7 = 0; } // If up, take C7 down and NULL it. |
|
|
|
|
|
|
|
myHome->logThisInfo("XCI", 0, "Shutdown"); // Log the shutdown. |
|
|
|
XCI_UP = false; // Set the flag. We're down! |