// For HTTP connections, the output (POST request) must
// be sent before we verify a successful connection.
// So, sacrifice a socket for the sake of testing...
// The following sequence should verify a successful
// HTTP connection if no IOException is thrown.
Socket testSocket = factory.createSocket(host, port);
InputStream in = testSocket.getInputStream();
int b = in.read(); // probably -1 for EOF...
testSocket.close();
} catch (IOException ex) {
if (proxyLog.isLoggable(Log.BRIEF)) {