congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ConnectFuture
Code IndexAdd Tabnine 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)

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
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JPanel (javax.swing)
  • Top plugins for WebStorm
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