labs.net.webChannel.Channel
Shared interface between Channel and TestChannel to support callbacks between WebChannelBase and BaseTestChannel and between Channel and ChannelRequest.

Inheritance

Constructor

goog.labs.net.webChannel.Channel()

Instance Methods

Public Protected Private
correctHostPrefix(serverHostPrefix) ?string
Not needed for testchannel. Allows the handler to override a host prefix provided by the server. Will be called whenever the channel has received such a prefix and is considering its use.
Arguments:
serverHostPrefix : ?string
The host prefix provided by the server.
Returns: ?string  The host prefix the client should use.
code »
createDataUri(hostPrefixpathopt_overridePort) goog.Uri
Not needed for testchannel. Creates a data Uri applying logic for secondary hostprefix, port overrides, and versioning.
Arguments:
hostPrefix : ?string
The host prefix.
path : string
The path on the host (may be absolute or relative).
opt_overridePort : number=
Optional override port.
Returns: goog.Uri  The data URI.
code »
createXhrIo(hostPrefix) !goog.net.XhrIo
Called when creating an XhrIo object. Override in a subclass if you need to customize the behavior, for example to enable the creation of XHR's capable of calling a secondary domain. Will also allow calling a secondary domain if withCredentials (CORS) is enabled.
Arguments:
hostPrefix : ?string
The host prefix, if we need an XhrIo object capable of calling a secondary domain.
Returns: !goog.net.XhrIo  A new XhrIo object.
code »
getBackChannelUri(hostPrefixpath) goog.Uri
Not needed for testchannel. Gets the Uri used for the connection that receives data from the server.
Arguments:
hostPrefix : ?string
The host prefix.
path : string
The path on the host.
Returns: goog.Uri  The back channel URI.
code »
getConnectionState() !goog.labs.net.webChannel.ConnectionState
Not needed for testchannel. Gets the result of previous connectivity tests.
Returns: !goog.labs.net.webChannel.ConnectionState  The connectivity state.
code »
getForwardChannelUri(path) goog.Uri
Not needed for testchannel. Gets the Uri used for the connection that sends data to the server.
Arguments:
path : string
The path on the host.
Returns: goog.Uri  The forward channel URI.
code »
isActive() boolean
Gets whether this channel is currently active. This is used to determine the length of time to wait before retrying. This call delegates to the handler.
Returns: boolean  Whether the channel is currently active.
code »
isClosed() boolean
Returns whether the channel is closed
Returns: boolean  true if the channel is closed.
code »
onRequestComplete(request)
Callback from ChannelRequest that indicates a request has completed.
Arguments:
request : !goog.labs.net.webChannel.ChannelRequest
The request object.
code »
onRequestData(requestresponseText)
Callback from ChannelRequest for when new data is received
Arguments:
request : goog.labs.net.webChannel.ChannelRequest
The request object.
responseText : string
The text of the response.
code »
shouldUseSecondaryDomains() boolean
Determines whether to use a secondary domain when the server gives us a host prefix. This allows us to work around browser per-domain connection limits. Currently, we use secondary domains when using Trident's ActiveXObject, because it supports cross-domain requests out of the box. Note that in IE10 we no longer use ActiveX since it's not supported in Metro mode and IE10 supports XHR streaming. If you need to use secondary domains on other browsers and IE10, you have two choices: 1) If you only care about browsers that support CORS (https://developer.mozilla.org/en-US/docs/HTTP_access_control), you can use #setSupportsCrossDomainXhrs and set the appropriate CORS response headers on the server. 2) Or, override this method in a subclass, and make sure that those browsers use some messaging mechanism that works cross-domain (e.g iframes and window.postMessage).
Returns: boolean  Whether to use secondary domains.
code »
testConnectionFailure(testChannelerrorCode)
Not needed for testchannel. Callback from TestChannel for when the channel has an error.
Arguments:
testChannel : goog.labs.net.webChannel.BaseTestChannel
The TestChannel.
errorCode : goog.labs.net.webChannel.ChannelRequest.Error
The error code of the failure.
code »
testConnectionFinished(testChanneluseChunked)
Not needed for testchannel. Callback from TestChannel for when the channel is finished.
Arguments:
testChannel : goog.labs.net.webChannel.BaseTestChannel
The TestChannel.
useChunked : boolean
Whether we can chunk responses.
code »

Package labs.net.webChannel

Package Reference