nsISpeculativeConnect 编辑

netwerk/base/public/nsISpeculativeConnect.idlScriptable Lets non-networking code provide hints to the networking layer that an HTTP connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up TCP and, if appropriate, SSL handshakes to save time when the connection is actually opened later. 1.0 66 Introduced Gecko 15.0 Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)

To use this service, simply call nsISupports.QueryInterface() on the nsIIOService you plan to use for the connection, to get access to the I/O service's implementation of nsISpeculativeConnect. Then call speculativeConnect() to let the networking layer know what you might be doing in the future.

Method overview

void speculativeConnect(in nsIURI aURI, in nsIInterfaceRequestor aCallbacks, in nsIEventTarget aTarget);

Methods

speculativeConnect()

Call this method to hint to the networking layer that a new transaction for the specified URI is likely to happen soon. The code implementing this method may use this information to start a TCP and/or SSL level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted.

No obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel.

void speculativeConnect(
  in nsIURI aURI,
  in nsIInterfaceRequestor aCallbacks,
  in nsIEventTarget aTarget
);
Parameters
aURI
The URI of the hinted transaction.
aCallbacks
Any security callbacks for use with SSL for interfaces such as nsIBadCertListener. May be null.
aTarget
The thread on which the release of the callbacks will occur. May be null for "any thread".

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:74 次

字数:3555

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文