C# 클래스 SnmpSharpNet.UdpTransport

IP/UDP transport class.
상속: IDisposable
파일 보기 프로젝트 열기: griffina/SnmpSharpNet

보호된 프로퍼티들

프로퍼티 타입 설명
_isIPv6 bool
_noSourceCheck bool
_socket Socket

공개 메소드들

메소드 설명
Close ( ) : void

Close network socket

Dispose ( ) : void

Dispose of the class.

Request ( IPAddress peer, int port, byte buffer, int bufferLength, int timeout, int retries ) : byte[]

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

UdpTransport ( bool useV6 ) : System

Constructor. Initializes and binds the Socket class

보호된 메소드들

메소드 설명
initSocket ( bool useV6 ) : void

Initialize class socket

비공개 메소드들

메소드 설명
AsyncRequestTimerCallback ( object stateInfo ) : void

Internal timer callback. Called by _asyncTimer when SNMP request timeout has expired

ReceiveBegin ( ) : void

Begin async version of ReceiveFrom member of the socket class.

ReceiveFromCallback ( IAsyncResult ar ) : void

Internal callback called as part of Socket.BeginReceiveFrom. Process incoming packets and notify caller of results.

RequestAsync ( IPAddress peer, int port, byte buffer, int bufferLength, int timeout, int retries, SnmpAsyncCallback asyncCallback ) : bool

Begin an async SNMP request

RetryAsyncRequest ( ) : void

Internal retry function. Checks if request has reached maximum number of retries and either resends the request if not reached, or sends request timed-out notification to the caller if maximum retry count has been reached and request has failed.

SendToBegin ( ) : void

Calls async version of the SendTo socket function.

SendToCallback ( IAsyncResult ar ) : void

Callback member called on completion of BeginSendTo send data operation.

메소드 상세

Close() 공개 메소드

Close network socket
public Close ( ) : void
리턴 void

Dispose() 공개 메소드

Dispose of the class.
public Dispose ( ) : void
리턴 void

Request() 공개 메소드

Make sync request using IP/UDP with request timeouts and retries.
Thrown on request timed out. SnmpException.ErrorCode is set to /// SnmpException.RequestTimedOut constant. Thrown when IPv4 address is passed to the v6 socket or vice versa
public Request ( IPAddress peer, int port, byte buffer, int bufferLength, int timeout, int retries ) : byte[]
peer System.Net.IPAddress SNMP agent IP address
port int SNMP agent port number
buffer byte Data to send to the agent
bufferLength int Data length in the buffer
timeout int Timeout in milliseconds
retries int Maximum number of retries. 0 = make a single request with no retry attempts
리턴 byte[]

UdpTransport() 공개 메소드

Constructor. Initializes and binds the Socket class
public UdpTransport ( bool useV6 ) : System
useV6 bool Set to true if you wish to initialize the transport for IPv6
리턴 System

initSocket() 보호된 메소드

Initialize class socket
protected initSocket ( bool useV6 ) : void
useV6 bool Should socket be initialized for IPv6 (true) of IPv4 (false)
리턴 void

프로퍼티 상세

_isIPv6 보호되어 있는 프로퍼티

Flag showing if class is using IPv6 or IPv4
protected bool _isIPv6
리턴 bool

_noSourceCheck 보호되어 있는 프로퍼티

Internal variable used to disable host IP address/port number check on received SNMP reply packets. If this option is disabled (default) only replies from the IP address/port number combination to which the request was sent will be accepted as valid packets. This value is set in the AgentParameters class and is only valid for SNMP v1 and v2c requests.
protected bool _noSourceCheck
리턴 bool

_socket 보호되어 있는 프로퍼티

Socket
protected Socket _socket
리턴 Socket