Make sync request using IP/UDP with request timeouts and retries.

Namespace: SnmpSharpNet
Assembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.9.1.0 (0.9.1)

Syntax

C#
public byte[] Request(
	IPAddress peer,
	int port,
	byte[] buffer,
	int bufferLength,
	int timeout,
	int retries
)
Visual Basic
Public Function Request ( _
	peer As IPAddress, _
	port As Integer, _
	buffer As Byte(), _
	bufferLength As Integer, _
	timeout As Integer, _
	retries As Integer _
) As Byte()
Visual C++
public:
array<unsigned char>^ Request(
	IPAddress^ peer, 
	int port, 
	array<unsigned char>^ buffer, 
	int bufferLength, 
	int timeout, 
	int retries
)

Parameters

peer
Type: System.Net..::..IPAddress
SNMP agent IP address
port
Type: System..::..Int32
SNMP agent port number
buffer
Type: array<System..::..Byte>[]()[][]
Data to send to the agent
bufferLength
Type: System..::..Int32
Data length in the buffer
timeout
Type: System..::..Int32
Timeout in milliseconds
retries
Type: System..::..Int32
Maximum number of retries. 0 = make a single request with no retry attempts

Return Value

Byte array returned by the agent. Null on error

Exceptions

ExceptionCondition
SnmpSharpNet..::..SnmpExceptionThrown on request timed out. SnmpException.ErrorCode is set to SnmpException.RequestTimedOut constant.
SnmpSharpNet..::..SnmpExceptionThrown when IPv4 address is passed to the v6 socket or vice versa

See Also