Class Discoverer
- Namespace
- Lextm.SharpSnmpLib.Messaging
- Assembly
- SharpSnmpLib.dll
Discoverer class to discover SNMP agents in the same network.
public sealed class Discoverer
- Inheritance
-
Discoverer
- Inherited Members
Constructors
Discoverer()
public Discoverer()
Methods
Discover(VersionCode, IPEndPoint, OctetString, int)
Discovers agents of the specified version in a specific time interval.
public void Discover(VersionCode version, IPEndPoint broadcastAddress, OctetString community, int interval)
Parameters
version
VersionCodeThe version.
broadcastAddress
IPEndPointThe broadcast address.
community
OctetStringThe community.
interval
intThe discovering time interval, in milliseconds.
Remarks
broadcastAddress
must be an IPv4 address. IPv6 is not yet supported here.
Discover(VersionCode, IPEndPoint, OctetString?, CancellationToken)
Discovers agents of the specified version in a specific time interval.
public void Discover(VersionCode version, IPEndPoint broadcastAddress, OctetString? community, CancellationToken token)
Parameters
version
VersionCodeThe version.
broadcastAddress
IPEndPointThe broadcast address.
community
OctetStringThe community.
token
CancellationTokenThe cancellation token.
Remarks
broadcastAddress
must be an IPv4 address. IPv6 is not yet supported here.
DiscoverAsync(VersionCode, IPEndPoint, OctetString, int)
Discovers agents of the specified version in a specific time interval.
public Task DiscoverAsync(VersionCode version, IPEndPoint broadcastAddress, OctetString community, int interval)
Parameters
version
VersionCodeThe version.
broadcastAddress
IPEndPointThe broadcast address.
community
OctetStringThe community.
interval
intThe discovering time interval, in milliseconds.
Returns
Remarks
broadcastAddress
must be an IPv4 address. IPv6 is not yet supported here.
DiscoverAsync(VersionCode, IPEndPoint, OctetString, CancellationToken)
Discovers agents of the specified version in a specific time interval.
public Task DiscoverAsync(VersionCode version, IPEndPoint broadcastAddress, OctetString community, CancellationToken token)
Parameters
version
VersionCodeThe version.
broadcastAddress
IPEndPointThe broadcast address.
community
OctetStringThe community.
token
CancellationTokenThe cancellation token.
Returns
Remarks
broadcastAddress
must be an IPv4 address. IPv6 is not yet supported here.
Events
AgentFound
Occurs when an SNMP agent is found.
public event EventHandler<AgentFoundEventArgs>? AgentFound
Event Type
ExceptionRaised
Occurs when an exception is raised.
public event EventHandler<ExceptionRaisedEventArgs>? ExceptionRaised
Event Type
Remarks
The exception is typical SocketException here.