nsISpeculativeConnect

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
28
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

Document Tags and Contributors

 Contributors to this page: Sheppy
 Last updated by: Sheppy,