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

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

Best Java code snippets using org.snmp4j.smi.TcpAddress.getPort (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

    tcpAddress.getPort());
setSocketOptions(ssc.socket());
ssc.socket().bind(isa);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

  tcpAddress.getPort());
setSocketOptions(ssc.socket());
ssc.socket().bind(isa);
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

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

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

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

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

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

Popular methods of TcpAddress

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

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JOptionPane (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 15 Vim Plugins
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