Skip to content
Snippets Groups Projects
Commit 78953289 authored by akwizgran's avatar akwizgran
Browse files

Flush the output stream after writing.

parent 4c9c49fa
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ abstract class DuplexTest { ...@@ -24,6 +24,7 @@ abstract class DuplexTest {
try { try {
PrintStream out = new PrintStream(d.getOutputStream()); PrintStream out = new PrintStream(d.getOutputStream());
out.println(CHALLENGE); out.println(CHALLENGE);
out.flush();
System.out.println("Sent challenge: " + CHALLENGE); System.out.println("Sent challenge: " + CHALLENGE);
Scanner in = new Scanner(d.getInputStream()); Scanner in = new Scanner(d.getInputStream());
if(in.hasNextLine()) { if(in.hasNextLine()) {
...@@ -58,6 +59,7 @@ abstract class DuplexTest { ...@@ -58,6 +59,7 @@ abstract class DuplexTest {
if(CHALLENGE.equals(challenge)) { if(CHALLENGE.equals(challenge)) {
PrintStream out = new PrintStream(d.getOutputStream()); PrintStream out = new PrintStream(d.getOutputStream());
out.println(RESPONSE); out.println(RESPONSE);
out.flush();
System.out.println("Sent response: " + RESPONSE); System.out.println("Sent response: " + RESPONSE);
} else { } else {
System.out.println("Incorrect challenge"); System.out.println("Incorrect challenge");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment