PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Limitation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
SNMPStartSession (Function)
In French: SNMPOuvreSession
Starts an SNMP session.
Example
SessionID is int
// Start a session
SessionID = SNMPStartSession("TestDoc", "public")
IF SessionID = -1 THEN Error("Error while opening the session " + ErrorInfo())
Syntax
<Result> = SNMPStartSession(<Agent Address> , <SNMP Community> [, <Time-out> [, <Port Number>]])
<Result>: Integer
  • Identifier of SNMP session,
  • -1 if an error occurred. ErrorInfo returns more details about the problem.
<Agent Address>: Character string (with quotes)
Address of agent with which the communication via SNMP will be established. This address can be given in the following format:
  • IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
  • URL containing the server name (www.windev.com for example). This syntax is recommended.
<SNMP Community>: Character string (with quotes)
Name of SNMP community used by the connection. This community indicates the rights associated with the SNMP session. In most cases, all the SNMP agents support the "public" community in read-only mode. Other communities can exist (private for example) for the access in read/write.
<Time-out>: Optional integer or optional Duration
Time-out (in milliseconds) of an SNMP request. This value must be included between 1000 and 10000. This parameter can correspond to:
  • an integer corresponding to the number of milliseconds,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
This parameter is set to 5000 by default (5 seconds).
<Port Number>: Optional integer
Number of the port to which we must connect. This value is set to 161 by default (standard SNMP port).
Remarks

Limitation

The SNMPxxx functions can only be used from Windows 2000 (they cannot be used with the following systems: Windows 98, Me or NT4).
SNMP is using the UDP protocol that is a connectionless protocol. Therefore, SNMPStartSession does not allow you to find out whether the contacted agent can actually be joined. SNMPStartSession returns a session once the SNMP request was sent, even if the agent is not available. To check whether an agent is actually connected, you have the ability to use:
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment