if (!paramOperatedClientConnection.isOpen())
throw new IllegalStateException("Connection must be open");
Scheme localScheme = this.schemeRegistry.getScheme(paramHttpHost.getSchemeName());
if (!(localScheme.getSchemeSocketFactory() instanceof SchemeLayeredSocketFactory))
throw new IllegalArgumentException("Target scheme (" + localScheme.getName() + ") must have layered socket factory.");
SchemeLayeredSocketFactory localSchemeLayeredSocketFactory = (SchemeLayeredSocketFactory)localScheme.getSchemeSocketFactory();
Socket localSocket;
try
{
localSocket = localSchemeLayeredSocketFactory.createLayeredSocket(paramOperatedClientConnection.getSocket(), paramHttpHost.getHostName(), paramHttpHost.getPort(), paramHttpParams);
}
catch (ConnectException localConnectException)
{
throw new HttpHostConnectException(paramHttpHost, localConnectException);
}
prepareSocket(localSocket, paramHttpContext, paramHttpParams);
paramOperatedClientConnection.update(localSocket, paramHttpHost, localSchemeLayeredSocketFactory.isSecure(localSocket), paramHttpParams);
}