本文整理了Java中io.netty.channel.socket.SocketChannel.isInputShutdown()
方法的一些代码示例,展示了SocketChannel.isInputShutdown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SocketChannel.isInputShutdown()
方法的具体详情如下:
包路径:io.netty.channel.socket.SocketChannel
类名称:SocketChannel
方法名:isInputShutdown
暂无
代码示例来源:origin: org.projectreactor/reactor-tcp
@Override
public boolean consumable() {
return !channel.isInputShutdown();
}
代码示例来源:origin: aadnk/ProtocolLib
@Override
public boolean isInputShutdown() {
return ch.isInputShutdown();
}
代码示例来源:origin: io.netty/netty-testsuite
public void testShutdownOutput(ServerBootstrap sb) throws Throwable {
TestHandler h = new TestHandler();
Socket s = new Socket();
Channel sc = null;
try {
sc = sb.childHandler(h).childOption(ChannelOption.ALLOW_HALF_CLOSURE, true).bind().sync().channel();
SocketUtils.connect(s, sc.localAddress(), 10000);
s.getOutputStream().write(1);
assertEquals(1, (int) h.queue.take());
assertTrue(h.ch.isOpen());
assertTrue(h.ch.isActive());
assertFalse(h.ch.isInputShutdown());
assertFalse(h.ch.isOutputShutdown());
s.shutdownOutput();
h.halfClosure.await();
assertTrue(h.ch.isOpen());
assertTrue(h.ch.isActive());
assertTrue(h.ch.isInputShutdown());
assertFalse(h.ch.isOutputShutdown());
assertEquals(1, h.closure.getCount());
Thread.sleep(100);
assertEquals(1, h.halfClosureCount.intValue());
} finally {
if (sc != null) {
sc.close();
}
s.close();
}
}
代码示例来源:origin: io.netty/netty-testsuite
public void testShutdownOutputWithoutOption(ServerBootstrap sb) throws Throwable {
TestHandler h = new TestHandler();
Socket s = new Socket();
Channel sc = null;
try {
sc = sb.childHandler(h).bind().sync().channel();
SocketUtils.connect(s, sc.localAddress(), 10000);
s.getOutputStream().write(1);
assertEquals(1, (int) h.queue.take());
assertTrue(h.ch.isOpen());
assertTrue(h.ch.isActive());
assertFalse(h.ch.isInputShutdown());
assertFalse(h.ch.isOutputShutdown());
s.shutdownOutput();
h.closure.await();
assertFalse(h.ch.isOpen());
assertFalse(h.ch.isActive());
assertTrue(h.ch.isInputShutdown());
assertTrue(h.ch.isOutputShutdown());
assertEquals(1, h.halfClosure.getCount());
Thread.sleep(100);
assertEquals(0, h.halfClosureCount.intValue());
} finally {
if (sc != null) {
sc.close();
}
s.close();
}
}
代码示例来源:origin: io.netty/netty-testsuite
assertFalse(h.ch.isInputShutdown());
assertFalse(h.ch.isOutputShutdown());
assertFalse(h.ch.isInputShutdown());
assertTrue(h.ch.isOutputShutdown());
代码示例来源:origin: io.netty/netty-testsuite
assertFalse(h.ch.isInputShutdown());
assertFalse(h.ch.isOutputShutdown());
assertFalse(h.ch.isInputShutdown());
assertTrue(h.ch.isOutputShutdown());
内容来源于网络,如有侵权,请联系作者删除!