嘗試連接客戶io.netty.bootstrap.Bootstrap
:網狀引導連接拒絕
ChannelFuture cf = null;
cf = m_bootstrap.connect(new InetSocketAddress(InetAddress
.getByName("127.0.0.1"), 8084));
在CF
,result
:java.net.ConnectException: Connection refused: /127.0.0.1:8084
詳細信息:
[sun.nio.ch.SocketChannelImpl.checkConnect(本機方法) , sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599), io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:208), io.netty.channel.nio.AbstractNioChannel $ AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:287), io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528), io.netty.channel.nio .NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468), io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382), io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354 ), io.netty.util.concurrent.SingleThreadEventExecutor $ 2.run(SingleThreadEventExecutor.java:116), java.lang.Thread.run(Thread.java:695)
我的/ etc/hosts文件文件看起來像這樣:
127.0.0.1>--localhost
255.255.255.255>broadcasthost
::1 localhost-
****::1%lo*>localhost
127.0.0.1>--********
不知道該怎麼辦?從字面上認爲我可以通過本地主機和端口,它應該工作。