414243444546474849
private static ServerSocketChannel newSocket() { try { return ServerSocketChannel.open(); } catch (IOException e) { throw new ChannelException( "Failed to open a server socket.", e); } }
6364656667686970
private static AsynchronousSocketChannel newSocket(AsynchronousChannelGroup group) { try { return AsynchronousSocketChannel.open(group); } catch (IOException e) { throw new ChannelException("Failed to open a socket.", e); } }
132133134135136137138139140
@Override public DatagramChannelConfig setInterface(InetAddress interfaceAddress) { try { setNetworkInterface(NetworkInterface.getByInetAddress(interfaceAddress)); } catch (SocketException e) { throw new ChannelException(e); } return this; }
166167168169170171172173174
throw new UnsupportedOperationException(); } else { try { return GET_OPTION.invoke(javaChannel, option); } catch (Exception e) { throw new ChannelException(e); } } }
178179180181182183184185186
throw new UnsupportedOperationException(); } else { try { SET_OPTION.invoke(javaChannel, option, value); } catch (Exception e) { throw new ChannelException(e); } } }
104105106107108109110111
@Override public ByteBuf data() { try { return getByteBuf(); } catch (IOException e) { throw new ChannelException(e); } }
7778798081828384
} catch (final Exception e2) { if (logger.isWarnEnabled()) { logger.warn("Failed to close channel.", e2); } } throw new ChannelException("Failed to configure channel.", e); } }
158159160161162163164165166167168
return 0; } if (receivedMessageSize >= maximumMessageSize) { javaChannel().close(); throw new ChannelException( "Invalid config : increase receive buffer size to avoid message truncation"); } // delivers a message buf.add(new UdtMessage(byteBuf));
7374757677787980
170171172173174175176177178179
ByteBuf buf = data(); if (buf != null) { try { upload.setContent(buf.copy()); } catch (IOException e) { throw new ChannelException(e); } } return upload; }