服务器端代码 import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; public class Server { private static ArrayList<Socket> list = new ArrayList<Socket>(); public static void main(String[] args)
Java实现Socket之TimeClient 代码内容 从time.nist.gov服务器的37号端口得到时间信息,并对时间进行解析后显示出来 代码实现 /* TimeClient.java */ import java.io.*; import java.net.*; import java.util.Date; public class TimeClient { public final static long differenceBetweenEpochs = 2208988800L;
import java.io.*; import java.net.ServerSocket; import java.net.Socket; import java.util.Scanner; /** * User: HYY * Date: 13-10-29 * Time: 下午9:57 * To change this template use File | Settings | File Templates. */ public class Server { public static f