PowerSNMP for .NET
Start(RequestReceived,IPEndPoint,Boolean,Boolean,Object) Method




A RequestReceived delegate specifying the method to execute when a RequestMessage is received.
IPEndPoint specifying the local network interface to bind to.
Specifies whether the Agent should accept requests that are broadcast to the network. Must be false when using an IPv4-mapped IPv6 dual mode socket.
Specifies whether the socket should be a dual mode IPv6 socket. Only supported on Vista and newer operating systems.
Object to pass to the callback method; can be null.
Starts receiving SNMP requests asynchronously, invoking the specified callback method on an IO completion thread as each RequestMessage is received.
Syntax
Public Overloads Sub Start( _
   ByVal callback As RequestReceived, _
   ByVal localEP As IPEndPoint, _
   ByVal acceptBroadcast As Boolean, _
   ByVal dualMode As Boolean, _
   ByVal state As Object _
) 
Dim instance As Agent
Dim callback As RequestReceived
Dim localEP As IPEndPoint
Dim acceptBroadcast As Boolean
Dim dualMode As Boolean
Dim state As Object
 
instance.Start(callback, localEP, acceptBroadcast, dualMode, state)

Parameters

callback
A RequestReceived delegate specifying the method to execute when a RequestMessage is received.
localEP
IPEndPoint specifying the local network interface to bind to.
acceptBroadcast
Specifies whether the Agent should accept requests that are broadcast to the network. Must be false when using an IPv4-mapped IPv6 dual mode socket.
dualMode
Specifies whether the socket should be a dual mode IPv6 socket. Only supported on Vista and newer operating systems.
state
Object to pass to the callback method; can be null.
Remarks

Use this method to receive SNMP requests from SNMP managers. It is possible for the RequestReceived delegate to be raised concurrently on multiple IO Completion threads, so its code should be thread-safe.

If dual mode (simultaneous IPv4 and IPv6) socket operation is desired, use IPAddress.IPv6Any (for all IPv4 and IPv6 interfaces) or an IPv4-mapped IPv6 address for the localEP address, and true for the dualMode argument. An IPv4-mapped IPv6 address is the IPv4 address of a network interface preceded by "::ffff:". Ex: ::ffff:192.168.1.1. If an IPv4-mapped IPv6 address is used then acceptBroadcast must be false. To accept broadcast packets in dual mode, IPAddress.IPv6Any must be used.

This method always creates a new SocketBase.Socket. Use multiple Agent instances to accept SNMP requests on multiple sockets.

Unhandled exceptions thrown on the IO Completion thread are caught and reported by the Error event.

Scripting applications should use Receive instead.

See Also

Reference

Agent Class
Agent Members
Overload List

6.1.1.2
PowerSNMP for .NET Documentation Version 7.0
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic