if (schm == null) {
throw new IllegalArgumentException
("Unknown scheme '" + target.getSchemeName() +
"' in target host.");
}
final SocketFactory sf = schm.getSocketFactory();
Socket sock = sf.createSocket();
conn.announce(sock);
try {
sock = sf.connectSocket(sock, target.getHostName(),
schm.resolvePort(target.getPort()),
local, 0, params);
} catch (ConnectException ex) {
throw new HttpHostConnectException(target, ex);
}
prepareSocket(sock, context, params);
final boolean secure = sf.isSecure(sock);
conn.open(sock, target, secure, params);
//@@@ error handling: unannounce at connection?
//@@@ error handling: close the created socket?