goog.labs.net.webChannel.Channel
Provided By | |
---|---|
All Known Implementations |
Core interface for WebChannelBase.
Instance Methods
this.correctHostPrefix( serverHostPrefix ) → (string|null)
(string|null)
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.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.createDataUri( hostPrefix, path, opt_overridePort ) → (goog.Uri|null)
(goog.Uri|null)
Not needed for testchannel.
Creates a data Uri applying logic for secondary hostprefix, port overrides, and versioning.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.createXhrIo( hostPrefix, isStreaming ) → goog.net.XhrIo
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.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.getBackChannelUri( hostPrefix, path ) → (goog.Uri|null)
(goog.Uri|null)
this.getConnectionState() → goog.labs.net.webChannel.ConnectionState
goog.labs.net.webChannel.ConnectionState
Not needed for testchannel. Gets the result of previous connectivity tests.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getForwardChannelUri( path ) → (goog.Uri|null)
(goog.Uri|null)
this.getHttpSessionId() → (string|null)
(string|null)
Gets the http session id.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getHttpSessionIdParam() → (string|null)
(string|null)
Gets the parameter name for the http session id.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isActive() → boolean
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.
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.isClosed() → boolean
boolean
Returns whether the channel is closed
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.onFirstByteReceived( request, responseText ) → void
void
Callback from ChannelRequest for when the first byte of response body has been received. This is needed for detecting buffering proxies.
Parameters |
|
---|
this.onRequestComplete( request ) → void
void
Callback from ChannelRequest that indicates a request has completed.
Parameters |
|
---|
this.onRequestData( request, responseText ) → void
void
Callback from ChannelRequest for when new data is received
Parameters |
|
---|
this.setHttpSessionId( httpSessionId ) → void
void
this.setHttpSessionIdParam( httpSessionIdParam ) → void
void
Sets the parameter name for the http session id.
Parameters |
|
---|
this.shouldUseSecondaryDomains() → boolean
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.
If you need to use secondary domains on different 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).
Parameters | None. | ||
---|---|---|---|
Returns |
| ||
See Also | http://code.google.com/p/closure-library/issues/detail?id=339 |
this.usesFetchStreams() → boolean
boolean
Whether or not this channel uses WHATWG Fetch/streams.
Parameters | None. | ||
---|---|---|---|
Returns |
|