當前位置: 首頁>>代碼示例>>Java>>正文


Java LayeredSocketFactory類代碼示例

本文整理匯總了Java中org.apache.http.conn.scheme.LayeredSocketFactory的典型用法代碼示例。如果您正苦於以下問題:Java LayeredSocketFactory類的具體用法?Java LayeredSocketFactory怎麽用?Java LayeredSocketFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LayeredSocketFactory類屬於org.apache.http.conn.scheme包,在下文中一共展示了LayeredSocketFactory類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GoogleHttpClient

import org.apache.http.conn.scheme.LayeredSocketFactory; //導入依賴的package包/類
private GoogleHttpClient(Context paramContext, String paramString, boolean paramBoolean)
{
  String str1 = paramString + " (" + Build.DEVICE + " " + Build.ID + ")";
  this.mClient = AndroidHttpClient.newInstance(str1 + "; gzip", paramContext);
  this.mCookieSourceApplier = new CookieSourceApplier(this.mClient, null, (byte)0);
  this.mResolver = paramContext.getContentResolver();
  this.mAppName = paramString;
  SchemeRegistry localSchemeRegistry = getConnectionManager().getSchemeRegistry();
  Iterator localIterator = localSchemeRegistry.getSchemeNames().iterator();
  if (localIterator.hasNext())
  {
    String str2 = (String)localIterator.next();
    Scheme localScheme = localSchemeRegistry.unregister(str2);
    SocketFactory localSocketFactory = localScheme.getSocketFactory();
    if ((localSocketFactory instanceof LayeredSocketFactory)) {}
    for (Object localObject = new WrappedLayeredSocketFactory((LayeredSocketFactory)localSocketFactory, (byte)0);; localObject = new WrappedSocketFactory(localSocketFactory, (byte)0))
    {
      localSchemeRegistry.register(new Scheme(str2, (SocketFactory)localObject, localScheme.getDefaultPort()));
      break;
    }
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:23,代碼來源:GoogleHttpClient.java

示例2: WrappedLayeredSocketFactory

import org.apache.http.conn.scheme.LayeredSocketFactory; //導入依賴的package包/類
private WrappedLayeredSocketFactory(LayeredSocketFactory paramLayeredSocketFactory)
{
  super(paramLayeredSocketFactory, (byte)0);
  this.mDelegate = paramLayeredSocketFactory;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:6,代碼來源:GoogleHttpClient.java

示例3: updateSecureConnection

import org.apache.http.conn.scheme.LayeredSocketFactory; //導入依賴的package包/類
public void updateSecureConnection(OperatedClientConnection conn,
                                   HttpHost target,
                                   HttpContext context,
                                   HttpParams params)
    throws IOException {


    if (conn == null) {
        throw new IllegalArgumentException
            ("Connection must not be null.");
    }
    if (target == null) {
        throw new IllegalArgumentException
            ("Target host must not be null.");
    }
    if (params == null) {
        throw new IllegalArgumentException
            ("Parameters must not be null.");
    }
    if (!conn.isOpen()) {
        throw new IllegalArgumentException
            ("Connection must be open.");
    }

    final Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
    if (!(schm.getSocketFactory() instanceof LayeredSocketFactory)) {
        throw new IllegalArgumentException
            ("Target scheme (" + schm.getName() +
             ") must have layered socket factory.");
    }

    final LayeredSocketFactory lsf = (LayeredSocketFactory) schm.getSocketFactory();
    final Socket sock; 
    try {
        sock = lsf.createSocket
            (conn.getSocket(), target.getHostName(), target.getPort(), true);
    } catch (ConnectException ex) {
        throw new HttpHostConnectException(target, ex);
    }
    prepareSocket(sock, context, params);
    conn.update(sock, target, lsf.isSecure(sock), params);
}
 
開發者ID:tdopires,項目名稱:cJUnit-mc626,代碼行數:43,代碼來源:DefaultClientConnectionOperator.java


注:本文中的org.apache.http.conn.scheme.LayeredSocketFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。