OpenNMS API 1.2.3

org.opennms.netmgt.utils
Class SocketChannelUtil

java.lang.Object
  extended byorg.opennms.netmgt.utils.SocketChannelUtil

public class SocketChannelUtil
extends java.lang.Object

Class to obtain a connected SocketChannel object.

Author:
Tarus Balog , OpenNMS

Constructor Summary
SocketChannelUtil()
           
 
Method Summary
static java.nio.channels.SocketChannel getConnectedSocketChannel(java.net.InetAddress host, int port, int timeout)
          This will attempt to connect to the passed host and port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketChannelUtil

public SocketChannelUtil()
Method Detail

getConnectedSocketChannel

public static java.nio.channels.SocketChannel getConnectedSocketChannel(java.net.InetAddress host,
                                                                        int port,
                                                                        int timeout)
                                                                 throws java.io.IOException,
                                                                        java.lang.InterruptedException
This will attempt to connect to the passed host and port. The connection will be made in non-blocking mode, so if there is no route to the host, then it won't hold up capsd or the poller. Once a connection is made, the channel is returned to blocking mode.

Parameters:
host - remote host
port - port
timeout - timeout (ms)
Returns:
SocketChannel object already connected to the remote host/port pair.
Throws:
java.io.IOException
java.lang.InterruptedException

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.