哦,我知道了,服务器端的原因

InetAddress addr = InetAddress.getLocalHost();
换成
InetAddress addr = InetAddress.getByName("127.0.0.1");
试试,有时Java并不像你想像的那么聪明哦^_^