Nicolas_Menant
Apr 10, 2008Employee
Retrieve number of current connections ?
Hi,
i developp an iControl api that will interact with the servers depending on the number of connection on each.
I have some issue to retrieve the number of current connections on each pool member:
Here is a test i do:
Here is the code
for (j = 0; j < mbstat[0].statistics[1].statistics.Length; j++)
if (mbstat[0].statistics[1].statistics[j].type == iControl.CommonStatisticType.STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS)
MessageBox.Show(mbstat[0].statistics[1].statistics[j].type.ToString() + ":" + mbstat[0].statistics[1].statistics[j].value.high.ToString());
I retrieve some value, it seems to always be 0 with high and with low i seem to have the proper value... what is the difference between the high and low value ?
When i add another test equivalent to this one i crash the application:
for (j = 0; j < mbstat[0].statistics[1].statistics.Length; j++)
if (mbstat[0].statistics[1].statistics[j].type == iControl.CommonStatisticType.STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS)
MessageBox.Show(mbstat[0].statistics[1].statistics[j].type.ToString() + ":" + mbstat[0].statistics[1].statistics[j].value.high.ToString());
if (mbstat[0].statistics[1].statistics[j].type == iControl.CommonStatisticType.STATISTIC_SERVER_SIDE_MAXIMUM_CONNECTIONS)
essageBox.Show(mbstat[0].statistics[1].statistics[j].type.ToString() + ":" + mbstat[0].statistics[1].statistics[j].value.high.ToString());
I have this error: Index was outside the bounds of the array. ... looks like it doesn't like STATISTIC_SERVER_SIDE_MAXIMUM_CONNECTIONS ?
Thanks for your help !