Table of Contents

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 VersionCode

The version.

broadcastAddress IPEndPoint

The broadcast address.

community OctetString

The community.

interval int

The 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 VersionCode

The version.

broadcastAddress IPEndPoint

The broadcast address.

community OctetString

The community.

token CancellationToken

The 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 VersionCode

The version.

broadcastAddress IPEndPoint

The broadcast address.

community OctetString

The community.

interval int

The discovering time interval, in milliseconds.

Returns

Task

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 VersionCode

The version.

broadcastAddress IPEndPoint

The broadcast address.

community OctetString

The community.

token CancellationToken

The cancellation token.

Returns

Task

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

EventHandler<AgentFoundEventArgs>

ExceptionRaised

Occurs when an exception is raised.

public event EventHandler<ExceptionRaisedEventArgs>? ExceptionRaised

Event Type

EventHandler<ExceptionRaisedEventArgs>

Remarks

The exception is typical SocketException here.