"\r\n";
OutputStream output2 = socket2.getOutputStream();
output2.write(request2.getBytes(StandardCharsets.UTF_8));
output2.flush();
SimpleHttpParser parser2 = new SimpleHttpParser();
BufferedReader input2 = new BufferedReader(new InputStreamReader(socket2.getInputStream(), StandardCharsets.UTF_8));
SimpleHttpResponse response2 = parser2.readResponse(input2);
Assert.assertEquals("200", response2.getCode());
}
socket1.setSoTimeout(2 * wait);
SimpleHttpParser parser1 = new SimpleHttpParser();
BufferedReader input1 = new BufferedReader(new InputStreamReader(socket1.getInputStream(), StandardCharsets.UTF_8));
SimpleHttpResponse response1 = parser1.readResponse(input1);
Assert.assertEquals(error, response1.getCode());
// Now try to make another request on the first connection
// to verify that we set correctly the read interest (#409842)
String request3 = "GET " + uri + " HTTP/1.1\r\n" +
"Host: localhost:" + connector.getLocalPort() + "\r\n" +
"\r\n";
output1.write(request3.getBytes(StandardCharsets.UTF_8));
output1.flush();
SimpleHttpResponse response3 = parser1.readResponse(input1);
Assert.assertEquals("200", response3.getCode());
}
}