Java Code Examples for io.netty.util.internal.SocketUtils#accept()
The following examples show how to use
io.netty.util.internal.SocketUtils#accept() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NioServerSocketChannel.java From netty-4.1.22 with Apache License 2.0 | 6 votes |
@Override protected int doReadMessages(List<Object> buf) throws Exception { SocketChannel ch = SocketUtils.accept(javaChannel()); try { if (ch != null) { buf.add(new NioSocketChannel(this, ch)); return 1; } } catch (Throwable t) { logger.warn("Failed to create a new channel from an accepted socket.", t); try { ch.close(); } catch (Throwable t2) { logger.warn("Failed to close a socket.", t2); } } return 0; }
Example 2
Source File: NioUdtAcceptorChannel.java From netty-4.1.22 with Apache License 2.0 | 5 votes |
@Override protected int doReadMessages(List<Object> buf) throws Exception { final SocketChannelUDT channelUDT = (SocketChannelUDT) SocketUtils.accept(javaChannel()); if (channelUDT == null) { return 0; } else { buf.add(newConnectorChannel(channelUDT)); return 1; } }