やあ。
たとえば、次のコードがありますが、正しく機能しています。
class main {
public static void main(String args[]) throws Exception {
Socket socks = new Socket("whois.internic.net", 43);
InputStream in = socks.getInputStream();
OutputStream out = socks.getOutputStream();
String str ;
str= "MHProfessional.com"+"\n";
byte buf[] = str.getBytes();
out.write(buf);
int c;
while ((c = in.read()) != -1) {
System.out.print((char) c);
}
//socks.close();
しかし、これを削除すると: +"\n"
. 次に、プログラムIDが機能せず、空白の画面が表示されます。なぜ?