最好也在服务端加上让服务器一直启动
public static void main(String[] args) throws Exception{
ServerSocket ss=new ServerSocket(10005);
while(true){
Socket s=ss.accept();
System.out.println(s.getInetAddress().getHostAddress());
OutputStream op=s.getOutputStream();
PrintWriter pw=new PrintWriter(op,true);
pw.println("<font size=7 color=red>注册成功</font>");
pw.close();
s.close();
}
} |