在端口9090上运行的TCP服务器
import java.io.IOException;// 来自 nowjava.com - 时代Java import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.util.Date; public class Server { public static void main(String[] args) throws IOException { ServerSocket listener = new ServerSocket(9090); try { while (true) { Socket socket = listener.accept(); try { PrintWriter out =/*from nowjava.com*/ new PrintWriter(socket.getOutputStream(), true); out.println("asdf"); }