labs.net.webChannel.BaseTestChannel Extends
A TestChannel is used during the first part of channel negotiation with the server to create the channel. It helps us determine whether we're behind a buffering proxy.

Inheritance

Constructor

goog.labs.net.webChannel.BaseTestChannel(channelchannelDebug)

Parameters

channel : !goog.labs.net.webChannel.Channel
The channel that owns this test channel.
channelDebug : !goog.labs.net.webChannel.WebChannelDebug
A WebChannelDebug instance to use for logging.

Instance Methods

Public Protected Private
abort()
Aborts the test channel.
code »
checkBufferingProxy_()
Begins the second stage of the test channel where we test to see if we're behind a buffering proxy. The server sends back a multi-chunked response with the first chunk containing the content '1' and then two seconds later sending the second chunk containing the content '2'. Depending on how we receive the content, we can tell if we're behind a buffering proxy.
code »
checkForEarlyNonBuffered_() boolean
No description.
Returns: boolean  True if test stage 2 detected a non-buffered channel early and early no buffering detection is enabled.
code »
connect(path)
Starts the test channel. This initiates connections to the server.
Arguments:
path : string
The relative uri for the test connection.
code »
createXhrIo()
No description.
code »
getClientProtocol() ?string
No description.
Returns: ?string  The client protocol as recorded with the init handshake request.
code »
getLastStatusCode() number
Returns the last status code received for a request.
Returns: number  The last status code received for a request.
code »
isActive()
No description.
code »
isClosed() boolean
Returns whether the test channel is closed. The ChannelRequest object expects this method to be implemented on its handler.
Returns: boolean  Whether the channel is closed.
code »
onRequestComplete(req)
Callback from ChannelRequest that indicates a request has completed.
Arguments:
req : !ChannelRequest
The request object.
code »
onRequestData(reqresponseText)
Callback from ChannelRequest for when new data is received
Arguments:
req : ChannelRequest
The request object.
responseText : string
The text of the response.
code »
recordClientProtocol_(req)
Record the client protocol header from the initial handshake response.
Arguments:
req : !ChannelRequest
The request object.
code »
setExtraHeaders(extraHeaders)
Sets extra HTTP headers to add to all the requests sent to the server.
Arguments:
extraHeaders : Object
The HTTP headers.
code »
shouldUseSecondaryDomains() boolean
No description.
Returns: boolean  Whether we should be using secondary domains when the server instructs us to do so.
code »

Instance Properties

The channel debug to use for logging
Code »
The channel that owns this test channel
Code »
clientProtocol_ :
The effective client protocol as indicated by the initial handshake response via the x-client-wire-protocol header.
Code »
correctHostPrefix :
No description.
Code »
createDataUri :
No description.
Code »
extraHeaders_ :
Extra HTTP headers to add to all the requests sent to the server.
Code »
firstTime_ :
The time for of the first result part. We use timing in IE as a heuristic for whether we're behind a buffering proxy.
Code »
getBackChannelUri :
No description.
Code »
getConnectionState :
No description.
Code »
getForwardChannelUri :
No description.
Code »
hostPrefix_ :
A subdomain prefix for using a subdomain in IE for the backchannel requests.
Code »
lastStatusCode_ :
The last status code received.
Code »
lastTime_ :
The time for of the last result part. We use timing in IE as a heuristic for whether we're behind a buffering proxy.
Code »
path_ :
The relative path for test requests.
Code »
receivedIntermediateResult_ :
Whether we have received the first result as an intermediate result. This helps us determine whether we're behind a buffering proxy.
Code »
The test request.
Code »
startTime_ :
The time when the test request was started. We use timing in IE as a heuristic for whether we're behind a buffering proxy.
Code »
state_ :
The state of the state machine for this object.
Code »
testConnectionFailure :
No description.
Code »
testConnectionFinished :
No description.
Code »

Static Properties

goog.labs.net.webChannel.BaseTestChannel.MIN_TIME_EXPECTED_BETWEEN_DATA_ :
Time between chunks in the test connection that indicates that we are not behind a buffering proxy. This value should be less than or equals to the time between chunks sent from the server.
Code »

Enumerations

goog.labs.net.webChannel.BaseTestChannel.State_ :
Enum type for the test channel state machine
Constants:
CONNECTION_TESTING
No description.
INIT
No description.
Code »

Package labs.net.webChannel

Package Reference