Tabnine Logo
ChannelException
Code IndexAdd Tabnine to your IDE (free)

How to use
ChannelException
in
org.jboss.netty.channel

Best Java code snippets using org.jboss.netty.channel.ChannelException (Showing top 20 results out of 315)

Refine searchRefine arrow

  • Socket
  • Channels
  • MulticastSocket
  • DatagramSocket
  • ChannelFuture
origin: io.netty/netty

OioAcceptedSocketChannel(
    Channel parent,
    ChannelFactory factory,
    ChannelPipeline pipeline,
    ChannelSink sink,
    Socket socket) {
  super(parent, factory, pipeline, sink, socket);
  try {
    in = new PushbackInputStream(socket.getInputStream(), 1);
  } catch (IOException e) {
    throw new ChannelException("Failed to obtain an InputStream.", e);
  }
  try {
    out = socket.getOutputStream();
  } catch (IOException e) {
    throw new ChannelException("Failed to obtain an OutputStream.", e);
  }
  fireChannelOpen(this);
  fireChannelBound(this, getLocalAddress());
}
origin: io.netty/netty

/**
 * Creates a new channel which is bound to the specified local address. This operation will block until
 * the channel is bound.
 *
 * @return a new bound channel which accepts incoming connections
 *
 * @throws ChannelException
 *         if failed to create a new channel and
 *                      bind it to the local address
 */
public Channel bind(final SocketAddress localAddress) {
  ChannelFuture future = bindAsync(localAddress);
  // Wait for the future.
  future.awaitUninterruptibly();
  if (!future.isSuccess()) {
    future.getChannel().close().awaitUninterruptibly();
    throw new ChannelException("Failed to bind to: " + localAddress, future.getCause());
  }
  return future.getChannel();
}
origin: io.netty/netty

OioSocketChannel(
    Channel parent,
    ChannelFactory factory,
    ChannelPipeline pipeline,
    ChannelSink sink,
    Socket socket) {
  super(parent, factory, pipeline, sink);
  this.socket = socket;
  try {
    socket.setSoTimeout(1000);
  } catch (SocketException e) {
    throw new ChannelException(
        "Failed to configure the OioSocketChannel socket timeout.", e);
  }
  config = new DefaultSocketChannelConfig(socket);
}
origin: io.netty/netty

public void setTcpNoDelay(boolean tcpNoDelay) {
  try {
    socket.setTcpNoDelay(tcpNoDelay);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: apache/incubator-druid

@Override
public void operationComplete(ChannelFuture f)
 if (f.isSuccess()) {
  sslHandler.handshake().addListener(
    new ChannelFutureListener()
      } else {
       handshakeFuture.setFailure(
         new ChannelException(
           StringUtils.format("Failed to handshake with host[%s]", hostname),
           f2.getCause()
  handshakeFuture.setFailure(
    new ChannelException(
      StringUtils.format("Failed to connect to host[%s]", hostname),
      f.getCause()
origin: io.netty/netty

public void setKeepAlive(boolean keepAlive) {
  try {
    socket.setKeepAlive(keepAlive);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: apache/incubator-druid

 @Override
 public void operationComplete(ChannelFuture future)
 {
  if (!future.isSuccess()) {
   channel.close();
   channelResourceContainer.returnResource();
   if (!retVal.isDone()) {
    retVal.setException(
      new ChannelException(
        StringUtils.format("[%s] Failed to write request to channel", requestDesc),
        future.getCause()
      )
    );
   }
  }
 }
}
origin: io.netty/netty

public void setSoLinger(int soLinger) {
  try {
    if (soLinger < 0) {
      socket.setSoLinger(false, 0);
    } else {
      socket.setSoLinger(true, soLinger);
    }
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: io.netty/netty

public void setSendBufferSize(int sendBufferSize) {
  try {
    socket.setSendBufferSize(sendBufferSize);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: io.netty/netty

public void setReceiveBufferSize(int receiveBufferSize) {
  try {
    socket.setReceiveBufferSize(receiveBufferSize);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: io.netty/netty

OioDatagramChannel(
    ChannelFactory factory,
    ChannelPipeline pipeline,
    ChannelSink sink) {
  super(null, factory, pipeline, sink);
  try {
    socket = new MulticastSocket(null);
  } catch (IOException e) {
    throw new ChannelException("Failed to open a datagram socket.", e);
  }
  try {
    socket.setSoTimeout(10);
    socket.setBroadcast(false);
  } catch (SocketException e) {
    throw new ChannelException(
        "Failed to configure the datagram socket timeout.", e);
  }
  config = new DefaultDatagramChannelConfig(socket);
  fireChannelOpen(this);
}
origin: io.netty/netty

public void setReuseAddress(boolean reuseAddress) {
  try {
    socket.setReuseAddress(reuseAddress);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: k3po/k3po

@Override
protected void unbindRequested(ChannelPipeline pipeline, ChannelStateEvent evt) throws Exception {
  final BBoshServerChannel bboshUnbindChannel = (BBoshServerChannel) evt.getChannel();
  final ChannelFuture bboshUnbindFuture = evt.getFuture();
  ChannelAddress bboshLocalAddress = bboshUnbindChannel.getLocalAddress();
  URI bboshLocation = bboshLocalAddress.getLocation();
  if (!bboshBindings.remove(bboshLocation, bboshUnbindChannel)) {
    bboshUnbindFuture.setFailure(new ChannelException("Channel not bound"));
    return;
  }
  Channel transport = bboshUnbindChannel.getTransport();
  ChannelFuture unbindFuture = transport.unbind();
  if (unbindFuture.isDone()) {
    handleBBoshTransportUnbindComplete(bboshUnbindChannel, bboshUnbindFuture, unbindFuture);
  }
  else {
    unbindFuture.addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture unbindFuture) throws Exception {
        handleBBoshTransportUnbindComplete(bboshUnbindChannel, bboshUnbindFuture, unbindFuture);
      }
    });
  }
}
origin: io.netty/netty

public int getReceiveBufferSize() {
  try {
    return socket.getReceiveBufferSize();
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: io.netty/netty

public int getSendBufferSize() {
  try {
    return socket.getSendBufferSize();
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: io.netty/netty

public void setReuseAddress(boolean reuseAddress) {
  try {
    socket.setReuseAddress(reuseAddress);
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
origin: k3po/k3po

tlsUnbindFuture.setFailure(new ChannelException("Channel not bound"));
return;
  if (unbindFuture.isDone()) {
    handleTlsTransportUnbindComplete(tlsUnbindChannel, tlsUnbindFuture, unbindFuture);
    unbindFuture.addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture unbindFuture) throws Exception {
fireChannelUnbound(tlsUnbindChannel);
tlsUnbindFuture.setSuccess();
origin: io.netty/netty

public void setTimeToLive(int ttl) {
  if (socket instanceof MulticastSocket) {
    try {
      ((MulticastSocket) socket).setTimeToLive(ttl);
    } catch (IOException e) {
      throw new ChannelException(e);
    }
  } else {
    throw new UnsupportedOperationException();
  }
}
origin: io.netty/netty

  public void setTrafficClass(int trafficClass) {
    try {
      socket.setTrafficClass(trafficClass);
    } catch (SocketException e) {
      throw new ChannelException(e);
    }
  }
}
origin: io.netty/netty

public boolean isTcpNoDelay() {
  try {
    return socket.getTcpNoDelay();
  } catch (SocketException e) {
    throw new ChannelException(e);
  }
}
org.jboss.netty.channelChannelException

Javadoc

A RuntimeException which is thrown when an I/O operation fails.

Most used methods

  • <init>
    Creates a new exception.
  • getMessage
  • addSuppressed
  • getCause
  • initCause

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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