Codota Logo
ConnectFuture
Code IndexAdd Codota to your IDE (free)

How to use
ConnectFuture
in
org.littleshoot.mina.common

Best Java code snippets using org.littleshoot.mina.common.ConnectFuture (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.littleshoot/littleshoot-ice

    localAddress, this.m_demuxingIoHandler);
cf.join();
try {
  final IoSession session = cf.getSession();
  if (session == null) {
    m_log.error("Could not create session from " + localAddress
origin: org.littleshoot/mina-port

public void fireExceptionCaught(IoSession session, Throwable cause) {
  // Notify the related ConnectFuture
  // if the session is created from SocketConnector.
  ConnectFuture future = (ConnectFuture) session
      .removeAttribute(CONNECT_FUTURE);
  if (future == null) {
    Entry head = this.head;
    callNextExceptionCaught(head, session, cause);
  } else {
    // Please note that this place is not the only place that
    // calls ConnectFuture.setException().
    future.setException(cause);
  }
}
origin: org.littleshoot/mina-port

public void sessionOpened(NextFilter nextFilter, IoSession session)
    throws Exception {
  try {
    session.getHandler().sessionOpened(session);
  } finally {
    // Notify the related ConnectFuture
    // if the session is created from SocketConnector.
    ConnectFuture future = (ConnectFuture) session
        .removeAttribute(CONNECT_FUTURE);
    if (future != null) {
      future.setSession(session);
    }
  }
}
origin: org.littleshoot/littleshoot-ice

cf.addListener(futureListener);
cf.join(connectTimeout);
m_log.debug("Successfully joined...");
try
  final IoSession session = cf.getSession();
  if (session == null)
origin: org.littleshoot/sip-client

future.join();
if (!future.isConnected()) {
  m_log.error("Could not connect to server at: " + remoteAddress);
  throw new IOException("Could not connect to server at: "
  session = future.getSession();
} catch (final RuntimeIOException e) {
origin: org.littleshoot/turn-client

connectFuture.addListener(futureListener);
connectFuture.join();
origin: org.littleshoot/stun-client

  localAddress, m_ioHandler);
LOG.debug("About to join");
cf.join();
LOG.debug("Connected to: {}", stunServer);
final IoSession session = cf.getSession();
if (session == null) {
  throw new IOException("Could not get session with: "
origin: org.littleshoot/tcp-framing

ioFuture.join(6000);
final IoSession session;
try
  session = ioFuture.getSession();
  if (session == null)
origin: org.littleshoot/turn-http-server

ioFuture.join(10 * 1000);
final IoSession session = ioFuture.getSession();
if (session == null || !session.isConnected()) {
  m_log.error("Could not connect to server: {}",
org.littleshoot.mina.commonConnectFuture

Javadoc

An IoFuture for asynchronous connect requests.

Example

 
IoConnector connector = ...; 
ConnectFuture future = connector.connect(...); 
future.join(); // Wait until the connection attempt is finished. 
IoSession session = future.getSession(); 
session.write(...); 

Most used methods

  • join
  • getSession
    Returns IoSession which is the result of connect operation.
  • addListener
  • isConnected
    Returns true if the connect operation is finished successfully.
  • setException
    Sets the exception caught due to connection failure and notifies all threads waiting for this future
  • setSession
    Sets the newly connected session and notifies all threads waiting for this future. This method is in

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now