org.snmp4j.Snmp.sendMessage()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.snmp4j.Snmp.sendMessage()方法的一些代码示例,展示了Snmp.sendMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Snmp.sendMessage()方法的具体详情如下:
包路径:org.snmp4j.Snmp
类名称:Snmp
方法名:sendMessage

Snmp.sendMessage介绍

[英]Actually sends a PDU to a target and returns a handle for the sent PDU.
[中]实际向目标发送PDU,并返回所发送PDU的句柄。

代码示例

代码示例来源:origin: org.snmp4j/snmp4j

public void send(PDU pdu, Target target, TransportMapping<?> transport, Object userHandle,
         ResponseListener listener) throws IOException {
  if (!pdu.isConfirmedPdu()) {
    sendMessage(pdu, target, transport, null);
    return;
  }
  if (timer == null) {
    createPendingTimer();
  }
  PendingRequest request =
      new AsyncPendingRequest(listener, userHandle, pdu, target, transport);
  sendMessage(request.pdu, target, transport, request);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public void send(PDU pdu, Target target,
         TransportMapping transport,
         Object userHandle,
         ResponseListener listener) throws IOException {
 if (!pdu.isConfirmedPdu()) {
  sendMessage(pdu, target, transport, null);
  return;
 }
 if (timer == null) {
  createPendingTimer();
 }
 PendingRequest request =
   new AsyncPendingRequest(listener, userHandle, pdu, target, transport);
 sendMessage(request.pdu, target, transport, request);
}

代码示例来源:origin: org.kaazing/snmp4j

public void send(PDU pdu, Target target,
         TransportMapping transport,
         Object userHandle,
         ResponseListener listener) throws IOException {
 if (!pdu.isConfirmedPdu()) {
  sendMessage(pdu, target, transport, null);
  return;
 }
 if (timer == null) {
  createPendingTimer();
 }
 PendingRequest request =
   new AsyncPendingRequest(listener, userHandle, pdu, target, transport);
 sendMessage(pdu, target, transport, request);
}

代码示例来源:origin: org.snmp4j/snmp4j

protected boolean resendRequest(PendingRequest request, PDU response) {
  if (request.useNextPDU()) {
    request.responseReceived = false;
    synchronized (pendingRequests) {
      pendingRequests.remove(request.key);
      PduHandle holdKeyUntilResendDone = request.key;
      request.key = null;
      handleInternalResponse(response, request.pdu, request.target.getAddress());
      try {
        sendMessage(request.pdu, request.target, request.transport, request);
      } catch (IOException e) {
        logger.error("IOException while resending request after RFC 5343 context engine ID discovery: " +
            e.getMessage(), e);
      }
      // now the previous retry can be released
      if (logger.isDebugEnabled()) {
        logger.debug("Releasing PDU handle " + holdKeyUntilResendDone);
      }
      holdKeyUntilResendDone = null;
    }
    return true;
  }
  return false;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

protected boolean resendRequest(PendingRequest request, PDU response) {
 if (request.useNextPDU()) {
  request.responseReceived = false;
  synchronized (pendingRequests) {
   pendingRequests.remove(request.key);
   PduHandle holdKeyUntilResendDone = request.key;
   request.key = null;
   handleInternalResponse(response, request.pdu, request.target.getAddress());
   try {
    sendMessage(request.pdu, request.target, request.transport, request);
   }
   catch (IOException e) {
    logger.error("IOException while resending request after RFC 5343 context engine ID discovery: " +
      e.getMessage(), e);
   }
   // now the previous retry can be released
   if (logger.isDebugEnabled()) {
    logger.debug("Releasing PDU handle "+holdKeyUntilResendDone);
   }
   holdKeyUntilResendDone = null;
  }
  return true;
 }
 return false;
}

代码示例来源:origin: org.snmp4j/snmp4j

private ResponseEvent send(PDU pdu, Target target, TransportMapping<?> transport, int maxRequestStatus)
    throws IOException {
  if (!pdu.isConfirmedPdu()) {
    sendMessage(pdu, target, transport, null);
    return null;
        new PendingRequest(syncResponse, target, pdu, target, transport);
    request.maxRequestStatus = maxRequestStatus;
    handle = sendMessage(request.pdu, target, transport, request);
    long totalTimeout =
        timeoutModel.getRequestTimeout(target.getRetries(),

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

int maxRequestStatus) throws IOException {
if (!pdu.isConfirmedPdu()) {
 sendMessage(pdu, target, transport, null);
 return null;
   new PendingRequest(syncResponse, target, pdu, target, transport);
 request.maxRequestStatus = maxRequestStatus;
 handle = sendMessage(request.pdu, target, transport, request);
 long totalTimeout =
   timeoutModel.getRequestTimeout(target.getRetries(),

代码示例来源:origin: org.kaazing/snmp4j

int maxRequestStatus) throws IOException {
if (!pdu.isConfirmedPdu()) {
 sendMessage(pdu, target, transport, null);
 return null;
   new PendingRequest(syncResponse, target, pdu, target, transport);
 request.maxRequestStatus = maxRequestStatus;
 handle = sendMessage(pdu, target, transport, request);
 long totalTimeout =
   timeoutModel.getRequestTimeout(target.getRetries(),

代码示例来源:origin: org.kaazing/snmp4j

try {
 PendingRequest nextRetry = new PendingRequest(this);
 sendMessage(m_pdu, m_target, m_transport, nextRetry);
 this.pendingRetry = false;

代码示例来源:origin: org.snmp4j/snmp4j

sendMessage(request.pdu, request.target, e.getTransportMapping(),
    null);

代码示例来源:origin: org.snmp4j/snmp4j

try {
  PendingRequest nextRetry = new PendingRequest(this);
  sendMessage(m_pdu, m_target, m_transport, nextRetry);
  this.pendingRetry = false;
  if (waitTime != null) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

try {
 PendingRequest nextRetry = new PendingRequest(this);
 sendMessage(m_pdu, m_target, m_transport, nextRetry);
 this.pendingRetry = false;
 if (waitTime != null) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

sendMessage(request.pdu, request.target, e.getTransportMapping(),
      null);

代码示例来源:origin: org.kaazing/snmp4j

sendMessage(request.pdu, request.target, e.getTransportMapping(),
      null);

相关文章