[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
AX_GetCommStats()
Returns current Advantage Database Server communication statistics
------------------------------------------------------------------------------
Syntax
AX_GetCommStats() -> array
Returns
Returns an 11 element array with current Advantage Database Server
communication statistics containing the following data:
[1] = (numeric) Percentage of packets that have checksum failures
[2] = (numeric) Total packets received by the Advantage Database Server
[3] = (numeric) Receive packets out of sequence
[4] = (numeric) Packet owner not logged in
[5] = (numeric) Receive requests out of sequence
[6] = (numeric) Checksum failures
[7] = (numeric) Server initiated disconnects
[8] = (numeric) Removed partial connections
[9] = (numeric) Received invalid packets (NT only)
[10] = (numeric) RecvFrom failed (NT only)
[11] = (numeric) SendTo failed (NT only)
- or -
Returns an empty array if an error occurred. If an error occurred,
AX_Error() will return information on why the function failed.
Description
AX_GetCommStats() returns an array containing the current Advantage
Database Server communication statistics. The communication statistics
show the packet and low level network status between Advantage clients
and the Advantage Database Server. The data is useful in determining
the traffic load and other system related server information.
It is possible that the number of elements in the communication
statistics array will increase in future releases of Advantage. Since
it is possible to use a newer version of the Advantage Database Server
with an older version of the Advantage CA-Clipper Client, any new and
additional communication statistics data that may exist if using a newer
version of the Advantage Database Server will not be returned in the
communication statistics array.
Since it is possible that the number of elements in the communication
statistics array will increase in future releases of Advantage, it is
highly recommended that the length of the returned array be calculated
using the Len() function, rather than hard-coding the expected length to
a literal value.
The following is a more detailed description of the communication
statistics information available in the returned communication
statistics array:
[1] = Percentage of total packets received that have check sum failures.
[2] = Total number of packets received from Advantage clients since the
Advantage Database Server was started/loaded.
[3] = Communications packets, which are assigned sequence numbers, are
sent between the Advantage client and the Advantage Database
Server. If a packet is received out of sequence, this data member
will be incremented. Packets may be out of sequence due to a
packet getting lost on the network which may cause it to show up
after others were received. If a packet is out of sequence, the
Advantage Database Server ignores it and waits for the resend.
[4] = The Advantage Database Server was unable to communicate with a
client properly and closed the connection. This occurs when a
request for a command, such as a SEEK, is a made before the user
is properly connected to the Advantage Database Server. Verify
your application is properly connecting to the Advantage Database
Server. Also, this data member is incremented when the Advantage
Database Server initiates a disconnect (see element 7), and the
client is still generating disconnect requests.
[5] = The client is requesting a resend of a packet from the Advantage
Database Server, but the packet is no longer available. Identify
the client that is generating the resends. Stop the application
and restart it. Monitor the results.
[6] = These represent the number of corrupted packets received over the
network. Corrupted packets are ignored by the Advantage Database
Server and new packets are resent from the Advantage client.
This is not something to be concerned with unless the percentage
of total packets that have check sum failures (in array element 1)
is high. It is difficult to determine what is "high". Reset the
communication statistics via AX_ResetCommStats() and get the
communication statistics again via this API. If large numbers of
corruptions occur in a short period of time, another application
or a bad network card may be corrupting the packets.
[7] = A normal client disconnect consists of two steps initiated by the
client: 1) the semaphore connection file is closed and 2) a
disconnect request is made. If a client PC crashes, is turned off
without logging off the network first, or if the network goes down,
a normal disconnect will not occur. The Advantage Database Server
"watch dog" thread identifies the client is gone and disconnects
the client automatically. This can also occur on a busy network
when step 2 above is not immediately serviced after step 1 occurs.
[8] = When a client connects to the Advantage Database Server, a reply
is sent to the client. The Advantage Database Server waits for a
response from the client to acknowledge the reply has been
received. If the client does not send a response, the Advantage
Database Server terminates the connection. This is a symptom of
an extremely busy network.
[9] = Number of invalid packets received specifically by the Advantage
Database Server for Windows NT/2000.
[10] = Number of errors that occurred when the Advantage Database Server
for Windows NT/2000 was receiving packets.
[11] = Number of errors that occurred when the Advantage Database Server
for Windows NT/2000 was sending packets.
Example
// Must first get a connection to the Advantage Database Server
USE x:dummy.dbf VIA "DBFCDXAX"
aCommStats := AX_GetCommStats()
// Display all communication statistics
for i := 1 to Len( aCommStats )
? aCommStats[i]
next
See Also: AX_ResetCommStats()
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson