Flush the output stream after writing.

This commit is contained in:
akwizgran
2012-12-06 15:44:58 +00:00
parent 4c9c49fa55
commit 78953289f7

View File

@@ -24,6 +24,7 @@ abstract class DuplexTest {
try {
PrintStream out = new PrintStream(d.getOutputStream());
out.println(CHALLENGE);
out.flush();
System.out.println("Sent challenge: " + CHALLENGE);
Scanner in = new Scanner(d.getInputStream());
if(in.hasNextLine()) {
@@ -58,6 +59,7 @@ abstract class DuplexTest {
if(CHALLENGE.equals(challenge)) {
PrintStream out = new PrintStream(d.getOutputStream());
out.println(RESPONSE);
out.flush();
System.out.println("Sent response: " + RESPONSE);
} else {
System.out.println("Incorrect challenge");