我先不讲别的,在我看来,你可能对http,或者ftp等没有弄过吧。你的程序中应该建立自己的协议,如String str=in.readLine();
System.out.println(str);
str=in.readLine();
System.out.println(str);
str=in.readLine();
System.out.println(str);
String serveraddress=in.readLine();ADDRESS 10.126.1.53
MSG Welcome to server!
...像你这样很容易把"Welcome to server"当ip来解析,这当然是会出现问题。