摘要: public class Client { public Client() { super(); } public static void main(String[] args) { //建立客户端连接 try { Socket s = new Socket("localhost", 9999); 阅读全文
posted @ 2019-05-13 16:57 侠客丶行 阅读(239) 评论(0) 推荐(0)
摘要: /** * 此代码是可以多客户端连接的 * 服务器一定要先读后写,不能颠倒 * 不到万不得已不要对ServerSocket进行关闭 */ public class Server0 { private static List<Socket> sockets = new ArrayList<Socket 阅读全文
posted @ 2019-05-13 16:56 侠客丶行 阅读(303) 评论(0) 推荐(0)