netSetMonitorParam (Function) |
Top Previous Next |
This function will set the parameters for the network monitor service. The parameters for the network monitoring service are non-volatile and therefore need only to be set once. Parameters take effect after a device resets (by using, for example, the boardReset function). The parameter set by netSetMonitorParam can be read by using netGetMonitorParam.
Use of the network monitoring service is recommended on network connections where the Gateway is not in use. When using the Gateway, the health of the connection is automatically monitored with the periodic self-transaction.
Network monitor service The network monitor is a service which will monitor the health of one or more network connections, and will automatically take the necessary recovery actions required to reestablish service. The network monitor will periodically check the health using one of the following methods:
0. Disabled No monitoring of the connection health will occur. When the monitoring is disabled there is no dependencies on DNS or PING servers in the network environment. 1. A DNS lookup. In this case, the monitor will perform a domain name look up, first on the primary DNS server, and if this fails because the DNS server did not respond, it will try again on the secondary DNS server (if present). The DNS server IP addresses will be derived from the network information.
2. A ICMP PING. In this case, the monitor will send an ICMP PING to the primary server, and if the fails, then again on the secondary server (if present). The primary and secondary servers used, must be set by the application.
The gprsSetMonitorParm function sets the parameters for the mobile network, but, unlike the netSetMonitorParam function, is limited to using the DNS lookup method of health check.
Input: iface : SINT (default 1) The network interface. 1 = Mobile network, 2 = LAN network, etc. (See Network) Please note that X32, NX32 and NX32L devices only support monitoring of the mobile network.
Enabled : BOOL Enable/Disable monitoring of the network connection.
method : SINT (default 1) The method used to check the health of the connection. (See above) 1 = DNS lookup, 2 = Ping address.
MaxAttempt : INT (1..60, default 3) Maximum number of failed health check attempts before the necessary recovery actions are initiated. Recommended is 3 times.
AliveFreq : DINT (30..60000 seconds, default 300) The number of seconds between successful health checks. Recommended alive-frequency is 300 seconds.
ping1 : DINT The IP address of the primary server. (only used by ping)
ping2 : DINT The IP address of the secondary server. (only used by ping)
Returns:
Declaration: FUNCTION netSetMonitorParam;
Example: INCLUDE rtcu.inc |