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




A NotificationReceived delegate specifying the method to execute when a message is received.
The local IPEndPoint the socket will bind to. Use port 162 for most applications.
Specifies whether the Manager 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.
Creates a socket and starts reading asynchronously. The specified user method executes on an IO Completion thread as each Trap1Message, Trap2Message or InformMessage is received.
Syntax
Public Overloads Sub Start( _
   ByVal callback As NotificationReceived, _
   ByVal localEP As IPEndPoint, _
   ByVal acceptBroadcast As Boolean, _
   ByVal dualMode As Boolean, _
   ByVal state As Object _
) 
Dim instance As Manager
Dim callback As NotificationReceived
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 NotificationReceived delegate specifying the method to execute when a message is received.
localEP
The local IPEndPoint the socket will bind to. Use port 162 for most applications.
acceptBroadcast
Specifies whether the Manager 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

This method presents all asynchronous messages that may be received by a Manager.

This method always creates a new SocketBase.Socket. Use multiple Manager instances to accept traps on multiple specific interfaces, or to accept both IPv4 and IPv6 traps on specific interfaces.

The localEP.AddressFamily must match the AddressFamily of the expected source of each message, unless dualMode is true and localEP.Address is IPAddress.IPv6Any or an IPv4-mapped IPv6 address. 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.

If an InformMessage is received (from another manager or an agent), use SnmpBase.Send to send the expected ResponseMessage. No response is expected when a trap is received.

Unhandled exceptions occurring on the worker thread will be caught and reported by the Error event.

Scripting applications should use Receive instead.

See Also

Reference

Manager Class
Manager 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