fix:控制台输入

上级 1b121ba4
......@@ -37,9 +37,9 @@ public class TestEventLoop_05_ChannelFuture {
})
//连接到服务器
.connect(new InetSocketAddress("localhost", 8080));
final Channel channel = channelFuture.sync().channel();
Channel channel = channelFuture.sync().channel();
new Thread(() -> {
final Scanner scanner = new Scanner(System.in, "UTF)");
final Scanner scanner = new Scanner(System.in);
while (true) {
final String line = scanner.nextLine();
if ("q".equals(line)) {
......@@ -48,6 +48,6 @@ public class TestEventLoop_05_ChannelFuture {
}
channel.writeAndFlush(line);
}
});
}, "input").start();
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册