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

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 25 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