对 Java 非常陌生。我的猜测是它应该是new Socket ("nothing",8)
?
public static void test(String s[]) {
try {
echoSocket = new Socket("nothing", 7);
out = new PrintWriter(echoSocket.getOutputStream(), true);
in = new BufferedReader( new InputStreamReader(echoSocket.getInputStream()));
} catch (UnknownHostException e) {
System.err.println("Don't know about host: .");
return;
}
process(out, in, echoSocket);
out.close();
in.close();
echoSocket.close();
}