Miaih
2017-09-06 02:29
客服端运行不了
Socket socket=new Socket("localhost",8888);
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.imoc.Client.main(Client.java:16)
换个端口号
没有啊 就最后关闭资源关闭了socket
多线程类里面,你是不是把socket关闭了
Java Socket应用---通信是这样练成的
125012 学习 · 590 问题
相似问题