标签:style java os io ar art line new
package org.tcp;}
package org.tcp;
import java.net.ServerSocket;
import java.net.Socket;
public class EchoThreadSocket {
public static void main(String[] args) throws Exception{
ServerSocket server = null;
Socket client = null;
server = new ServerSocket(8888);
boolean f = true;
while(f){
System.out.println("服务器运行,等待客户端链接。");
client = server.accept();
new Thread(new EchoThread(client)).start();
}
server.close();
}
}
Java网络编程(tcp在服务器上应用多线程),布布扣,bubuko.com
标签:style java os io ar art line new
原文地址:http://blog.csdn.net/u012927417/article/details/38601653