Tabnine Logo
TcpAddress.getInetAddress
Code IndexAdd Tabnine to your IDE (free)

How to use
getInetAddress
method
in
org.snmp4j.smi.TcpAddress

Best Java code snippets using org.snmp4j.smi.TcpAddress.getInetAddress (Showing top 17 results out of 315)

origin: org.snmp4j/snmp4j

/**
 * Create a {@link TlsAddress} from a {@link TcpAddress}.
 * @param tcpAddress
 *    the {@link TcpAddress} for the new {@link TlsAddress}.
 * @since 3.0.5
 */
public TlsAddress(TcpAddress tcpAddress) {
  super(tcpAddress.getInetAddress(), tcpAddress.getPort());
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

@Override
public TcpAddress getListenAddress() {
 int port = tcpAddress.getPort();
 ServerThread serverThreadCopy = serverThread;
 try {
  port = serverThreadCopy.ssc.socket().getLocalPort();
 }
 catch (NullPointerException npe) {
  // ignore
 }
 return new TcpAddress(tcpAddress.getInetAddress(), port);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

public ServerThread() throws IOException, NoSuchAlgorithmException {
 // Selector for incoming requests
 selector = Selector.open();
 if (serverEnabled) {
  // Create a new server socket and set to non blocking mode
  ssc = ServerSocketChannel.open();
  ssc.configureBlocking(false);
  // Bind the server socket
  InetSocketAddress isa = new InetSocketAddress(tcpAddress.getInetAddress(),
    tcpAddress.getPort());
  setSocketOptions(ssc.socket());
  ssc.socket().bind(isa);
  // Register accepts on the server socket with the selector. This
  // step tells the selector that the socket wants to be put on the
  // ready list when accept operations occur, so allowing multiplexed
  // non-blocking I/O to take place.
  ssc.register(selector, SelectionKey.OP_ACCEPT);
 }
}
origin: org.snmp4j/snmp4j

public ServerThread() throws IOException, NoSuchAlgorithmException {
  super(TLSTM.this);
  // Selector for incoming requests
  if (serverEnabled) {
    // Create a new server socket and set to non blocking mode
    ssc = ServerSocketChannel.open();
    ssc.configureBlocking(false);
    // Bind the server socket
    InetSocketAddress isa = new InetSocketAddress(tcpAddress.getInetAddress(),
        tcpAddress.getPort());
    setSocketOptions(ssc.socket());
    ssc.socket().bind(isa);
    // Register accepts on the server socket with the selector. This
    // step tells the selector that the socket wants to be put on the
    // ready list when accept operations occur, so allowing multiplexed
    // non-blocking I/O to take place.
    ssc.register(selector, SelectionKey.OP_ACCEPT);
  }
}
origin: org.kaazing/snmp4j

public ServerThread() throws IOException {
 buf = new byte[getMaxInboundMessageSize()];
 // Selector for incoming requests
 selector = Selector.open();
 if (serverEnabled) {
  // Create a new server socket and set to non blocking mode
  ssc = ServerSocketChannel.open();
  ssc.configureBlocking(false);
  // Bind the server socket
  InetSocketAddress isa = new InetSocketAddress(tcpAddress.getInetAddress(),
    tcpAddress.getPort());
  setSocketOptions(ssc.socket());
  ssc.socket().bind(isa);
  // Register accepts on the server socket with the selector. This
  // step tells the selector that the socket wants to be put on the
  // ready list when accept operations occur, so allowing multiplexed
  // non-blocking I/O to take place.
  ssc.register(selector, SelectionKey.OP_ACCEPT);
 }
}
origin: org.snmp4j/snmp4j

@Override
public TcpAddress getListenAddress() {
  int port = tcpAddress.getPort();
  ServerThread serverThreadCopy = serverThread;
  try {
    port = ((InetSocketAddress) serverThreadCopy.ssc.getLocalAddress()).getPort();
  } catch (NullPointerException npe) {
    // ignore
  } catch (IOException e) {
    e.printStackTrace();
  }
  return new TcpAddress(tcpAddress.getInetAddress(), port);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

@Override
public TcpAddress getListenAddress() {
 int port = tcpAddress.getPort();
 ServerThread serverThreadCopy = serverThread;
 try {
  port = ((InetSocketAddress)serverThreadCopy.ssc.getLocalAddress()).getPort();
 }
 catch (NullPointerException npe) {
  // ignore
 } catch (IOException e) {
  e.printStackTrace();
 }
 return new TcpAddress(tcpAddress.getInetAddress(), port);
}
origin: org.snmp4j/snmp4j

@Override
public TcpAddress getListenAddress() {
  int port = tcpAddress.getPort();
  ServerThread serverThreadCopy = serverThread;
  try {
    port = serverThreadCopy.ssc.socket().getLocalPort();
  } catch (NullPointerException npe) {
    if (logger.isDebugEnabled()) {
      logger.debug("TLSTM.getListenAddress called but TLSTM is not listening yet");
    }
  }
  return new TcpAddress(tcpAddress.getInetAddress(), port);
}
origin: org.snmp4j/snmp4j

InetSocketAddress isa = new InetSocketAddress(tcpAddress.getInetAddress(),
    tcpAddress.getPort());
setSocketOptions(ssc.socket());
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

InetSocketAddress isa = new InetSocketAddress(tcpAddress.getInetAddress(),
  tcpAddress.getPort());
setSocketOptions(ssc.socket());
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

  public SocketEntry(TcpAddress address, Socket socket,
            boolean useClientMode,
            TransportStateReference tmStateReference) throws NoSuchAlgorithmException {
   this.inAppBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
   this.inNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
   this.outNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
   this.peerAddress = address;
   this.tmStateReference = tmStateReference;
   this.socket = socket;
   this.lastUse = System.nanoTime();
   if (tmStateReference == null) {
    counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionAccepts));
   }
   SSLContext sslContext = sslEngineConfigurator.getSSLContext(useClientMode, tmStateReference);
   this.sslEngine = sslContext.createSSLEngine(address.getInetAddress().getHostName(), address.getPort());
   sslEngine.setUseClientMode(useClientMode);
//      sslEngineConfigurator.configure(SSLContext.getDefault(), useClientMode);
   sslEngineConfigurator.configure(sslEngine);
   synchronized (TLSTM.this) {
    sessionID = nextSessionID++;
   }
  }

origin: org.snmp4j/snmp4j

public SocketEntry(TcpAddress address, Socket socket,
          boolean useClientMode,
          TransportStateReference tmStateReference) throws NoSuchAlgorithmException {
  super(address, socket);
  this.inAppBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
  this.inNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
  this.outNetBuffer = ByteBuffer.allocate(getMaxInboundMessageSize());
  this.tmStateReference = tmStateReference;
  if (tmStateReference == null) {
    counterSupport.fireIncrementCounter(new CounterEvent(this, SnmpConstants.snmpTlstmSessionAccepts));
  }
  SSLEngineConfigurator sslEngineConfigurator = ensureSslEngineConfigurator();
  SSLContext sslContext = sslEngineConfigurator.getSSLContext(useClientMode, tmStateReference);
  this.sslEngine = sslContext.createSSLEngine(address.getInetAddress().getHostName(), address.getPort());
  sslEngine.setUseClientMode(useClientMode);
  sslEngineConfigurator.configure(sslEngine);
  synchronized (TLSTM.this) {
    sessionID = nextSessionID++;
  }
}
origin: org.kaazing/snmp4j

try {
 InetSocketAddress targetAddress =
   new InetSocketAddress(((TcpAddress)address).getInetAddress(),
              ((TcpAddress)address).getPort());
 if ((s == null) || (s.isClosed())) {
origin: org.snmp4j/snmp4j

try {
  InetSocketAddress targetAddress =
      new InetSocketAddress(((TcpAddress) address).getInetAddress(),
          ((TcpAddress) address).getPort());
  if ((s == null) || (s.isClosed())) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

try {
 InetSocketAddress targetAddress =
   new InetSocketAddress(((TcpAddress)address).getInetAddress(),
              ((TcpAddress)address).getPort());
 if ((s == null) || (s.isClosed())) {
origin: org.snmp4j/snmp4j

try {
  InetSocketAddress targetAddress =
      new InetSocketAddress(((TcpAddress) address).getInetAddress(),
          ((TcpAddress) address).getPort());
  if ((s == null) || (s.isClosed())) {
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

try {
 InetSocketAddress targetAddress =
   new InetSocketAddress(((TcpAddress)address).getInetAddress(),
              ((TcpAddress)address).getPort());
 if ((s == null) || (s.isClosed())) {
org.snmp4j.smiTcpAddressgetInetAddress

Popular methods of TcpAddress

  • <init>
  • getPort
  • parseAddress
  • setInetAddress
  • setPort
  • equals
  • hashCode

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now