こんにちは、私は不思議でした。 私は私のゲームのためのマルチプレイヤーを作成していると私は何かを送りたい場合は は、私が使用する必要があります。各入出力後にDataInputStreamまたはDataOutputStreamを再作成する必要がありますか?
dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
dos.writeUTF(username);
dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
dos.writeUTF("test");
dis = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
String loginResponse = dis.readUTF();
または私が使用する必要があります。
dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
dos.writeUTF(username);
dos.writeUTF("test");
dis = new DataInputStream(new BufferedInputStream(socket.getInputStream()));
String loginResponse = dis.readUTF();
どのような操作で新しいストリームが必要になると思いますか? – Thomas
チュートリアル私はYoutubeで見ましたが、ナンセンスだと思っています。ちょっとわかりません。 – IvanDonat