goog.labs.net.webChannel.WebChannelBase |
opt_options
: !goog.net.WebChannel.Options=
Configuration for the
WebChannel instance.
|
opt_clientVersion
: string=
An application-specific version number
that is sent to the server when connected.
|
opt_conn
: !ConnectionState=
Previously determined connection
conditions.
|
![]()
Adds the additional parameters from the handler to the given URI.
Arguments:
|
code » | ||||||
![]()
Cancels all outstanding requests.
|
code » | ||||||
![]()
Clears the timer that indicates that our backchannel is no longer able to
successfully receive data from the server.
|
code » | ||||||
![]()
Starts the channel. This initiates connections to the server.
Arguments:
|
code » | ||||||
![]()
Starts the regular channel which is run after the test channel is complete.
|
code » | ||||||
![]()
Starts the test channel to determine network conditions.
Arguments:
|
code » | ||||||
Decides which host prefix should be used, if any. If there is a handler,
allows the handler to validate a host prefix provided by the server, and
optionally override it.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
Returns the request text from the outgoing maps and resets it.
Returns: string
The encoded request text created from all the currently
queued outgoing maps.
|
code » | ||||||
![]()
Disconnects and closes the channel.
|
code » | ||||||
![]()
Ensures there is a backchannel request for receiving data from the server.
|
code » | ||||||
![]()
Ensures that a forward channel request is scheduled.
|
code » | ||||||
![]()
Helper to ensure the channel is in the expected state.
Arguments:
|
code » | ||||||
![]()
Returns whether chunked mode is allowed. In certain debugging situations,
it's useful for the application to have a way to disable chunked mode for a
user.
@return {boolean} Whether chunked mode is allowed.
|
code » | ||||||
Returns whether the channel allows the use of a subdomain. There may be
cases where this isn't allowed.
Returns: boolean
Whether a host prefix is allowed.
|
code » | ||||||
No description.
Returns: number
The max number of back-channel retries, which is a constant.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Returns the logger.
Returns: !WebChannelDebug
The channel debug object.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
Returns the extra HTTP headers to add to all the requests sent to the server.
Returns: Object
The HTTP headers, or null.
|
code » | ||||||
No description.
Returns: number
The max number of forward-channel retries, which will be 0
in fail-fast mode.
|
code » | ||||||
![]()
No description.
Returns: !ForwardChannelRequestPool
The forward channel request pool.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Returns the handler used for channel callback events.
Returns: WebChannelBase.Handler
The handler.
|
code » | ||||||
No description.
Returns: number
The last array id received.
|
code » | ||||||
Return the last status code received for a request.
Returns: number
The last status code received for a request.
|
code » | ||||||
Returns the number of outstanding requests.
Returns: number
The number of outstanding requests to the server.
|
code » | ||||||
No description.
|
code » | ||||||
Returns the session id of the channel. Only available after the
channel has been opened.
Returns: string
Session ID.
|
code » | ||||||
![]()
Returns the channel state.
Returns: WebChannelBase.State
The current state of the channel.
|
code » | ||||||
No description.
Returns: !Object
The codec object, to be used for the test channel.
|
code » | ||||||
![]()
Handles a POST response from the server telling us that it has detected that
we have no hanging GET connection.
Arguments:
|
code » | ||||||
![]()
Handles a POST response from the server.
Arguments:
|
code » | ||||||
Returns whether there are outstanding requests servicing the channel.
Returns: boolean
true if there are outstanding requests.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
Returns whether the channel is buffered or not. This state is valid for
querying only after the test connection has completed. This may be
queried in the WebChannelBase.okToMakeRequest() callback.
A channel may be buffered if the test connection determines that
a chunked response could not be sent down within a suitable time.
Returns: boolean
Whether the channel is buffered.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Makes a forward channel request using XMLHTTP.
Arguments:
|
code » | ||||||
Schedules a back-channel retry, unless the max retries has been reached.
Returns: boolean
true iff a retry was scheduled.
|
code » | ||||||
Schedules a forward-channel retry for the specified request, unless the max
retries has been reached.
Arguments:
Returns: boolean
true iff a retry was scheduled.
|
code » | ||||||
Gives the handler a chance to return an error code and stop channel
execution. A handler might want to do this to check that the user is still
logged in, for example.
Returns: boolean
If it's OK to make a request.
|
code » | ||||||
![]()
Handles the timer that indicates that our backchannel is no longer able to
successfully receive data from the server.
|
code » | ||||||
![]()
Called when the channel has been closed. It notifiers the handler of the
event, and reports any pending or undelivered maps.
|
code » | ||||||
![]()
Called when we've determined the final error for a channel. It closes the
notifiers the handler of the error and closes the channel.
Arguments:
|
code » | ||||||
![]()
Processes the data returned by the server.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Timer callback for ensureBackChannel_.
|
code » | ||||||
![]()
Timer callback for ensureForwardChannel
Arguments:
|
code » | ||||||
![]()
Called when messages have been successfully sent from the queue.
|
code » | ||||||
![]()
Establishes a new channel session with the the server.
|
code » | ||||||
![]()
Requeues unacknowledged sent arrays for retransmission in the next forward
channel request.
|
code » | ||||||
![]()
Sends a request to the server. The format of the request is a Map data
structure of key/value pairs. These maps are then encoded in a format
suitable for the wire and then reconstituted as a Map data structure that
the server can process.
Arguments:
|
code » | ||||||
![]()
Sets whether chunked mode is allowed. In certain debugging situations, it's
useful for the application to have a way to disable chunked mode for a user.
Arguments:
|
code » | ||||||
![]()
Sets whether the channel allows the use of a subdomain. There may be cases
where this isn't allowed, for example, logging in with troutboard where
using a subdomain causes Apache to force the user to authenticate twice.
Arguments:
|
code » | ||||||
![]()
Sets the logger.
Arguments:
|
code » | ||||||
![]()
Sets extra HTTP headers to add to all the requests sent to the server.
Arguments:
|
code » | ||||||
![]()
When set to true, this changes the behavior of the forward channel so it
will not retry requests; it will fail after one network failure, and if
there was already one network failure, the request will fail immediately.
Arguments:
|
code » | ||||||
![]()
Sets the maximum number of attempts to connect to the server for forward
channel requests.
Arguments:
|
code » | ||||||
![]()
Sets the timeout for a forward channel request.
Arguments:
|
code » | ||||||
![]()
Sets the handler used for channel callback events.
Arguments:
|
code » | ||||||
![]()
Sets the throttle for handling onreadystatechange events for the request.
Arguments:
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Sets whether cross origin requests are supported for the channel.
Setting this allows the creation of requests to secondary domains and
sends XHRs with the CORS withCredentials bit set to true.
In order for cross-origin requests to work, the server will also need to set
CORS response headers as per:
https://developer.mozilla.org/en-US/docs/HTTP_access_control
See
goog.net.XhrIo#setWithCredentials .
Arguments:
|
code » | ||||||
Determines whether we should start the process of retrying a possibly
dead backchannel.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Signals an error has occurred.
Arguments:
|
code » | ||||||
![]()
Begins a new back channel operation to the server.
|
code » | ||||||
![]()
Begins a new forward channel operation to the server.
Arguments:
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
No description.
|
code » | ||||||
![]()
Callback for netUtils.testNetwork during error handling.
Arguments:
|
code » |
Previous connectivity test results.
|
Code » | |
![]()
Whether chunked mode is allowed. In certain debugging situations, it's
useful to disable this.
|
Code » | |
![]()
Whether we allow the use of a subdomain in IE for the backchannel requests.
|
Code » | |
![]()
The attempt id for the current back channel request. Starts at 1 and
increments for each reconnect. The server uses this to log if our
connection is flaky or not.
|
Code » | |
The ChannelRequest object for the backchannel.
|
Code » | |
![]()
Number of times in a row that we have retried the current back channel
request and received no data.
|
Code » | |
![]()
Timer identifier for asynchronously making a back channel request.
|
Code » | |
The absolute URI for the backchannel request.
|
Code » | |
![]()
The base part of the time before firing next retry request. Default is 5
seconds. Note that a random delay is added (see
retryDelaySeedMs_ )
for all retries, and linear backoff is applied to the sum for subsequent
retries.
|
Code » | |
The channel debug used for logging
|
Code » | |
![]()
The channel version that we negotiated with the server for this session.
Starts out as the version we request, and then is changed to the negotiated
version after the initial open.
|
Code » | |
![]()
The application specific version that is passed to the server.
|
Code » | |
The TestChannel object which encapsulates the logic for determining
interesting network conditions about the client.
|
Code » | |
![]()
Timer identifier for the timer that waits for us to retry the backchannel
in the case where it is dead and no longer receiving data.
|
Code » | |
![]()
Extra HTTP headers to add to all the requests sent to the server.
|
Code » | |
![]()
Extra parameters to add to all the requests sent to the server.
|
Code » | |
![]()
Whether to fail forward-channel requests after one try or a few tries.
|
Code » | |
![]()
Maximum number of attempts to connect to the server for forward channel
requests. Defaults to 2.
|
Code » | |
The current ChannelRequest pool for the forward channel.
|
Code » | |
![]()
The timeout in milliseconds for a forward channel request. Defaults to 20
seconds. Note that part of this timeout can be randomized.
|
Code » | |
![]()
Number of times we have retried the current forward channel request.
|
Code » | |
![]()
Timer identifier for asynchronously making a forward channel request.
|
Code » | |
The absolute URI for the forwardchannel request.
|
Code » | |
The handler that receive callbacks for state changes and data.
|
Code » | |
![]()
A subdomain prefix for using a subdomain in IE for the backchannel
requests.
|
Code » | |
![]()
The array identifier of the last array received from the server for the
backchannel request.
|
Code » | |
![]()
The array id of the last array sent by the server that we know about.
|
Code » | |
![]()
The last status code received.
|
Code » | |
![]()
The id to use for the next outgoing map. This identifier uniquely
identifies a sent map.
|
Code » | |
![]()
The next id to use for the RID (request identifier) parameter. This
identifier uniquely identifies the forward channel request.
|
Code » | |
![]()
An array of queued maps that need to be sent to the server.
|
Code » | |
![]()
The relative path (in the context of the the page hosting the browser
channel) for making requests to the server.
|
Code » | |
![]()
An array of dequeued maps that we have either received a non-successful
response for, or no response at all, and which therefore may or may not
have been received by the server.
|
Code » | |
![]()
A throttle time in ms for readystatechange events for the backchannel.
Useful for throttling when ready state is INTERACTIVE (partial data).
This throttle is useful if the server sends large data chunks down the
backchannel. It prevents examining XHR partial data on every readystate
change event. This is useful because large chunks can trigger hundreds
of readystatechange events, each of which takes ~5ms or so to handle,
in turn making the UI unresponsive for a significant period.
If set to zero no throttle is used.
|
Code » | |
![]()
A random time between 0 and this number of MS is added to the
baseRetryDelayMs_ . Default is 10 seconds.
|
Code » | |
![]()
The current session id.
|
Code » | |
![]()
The current state of the WebChannel.
|
Code » | |
![]()
Whether cross origin requests are supported for the channel.
See
goog.net.XhrIo#setWithCredentials .
|
Code » | |
![]()
Whether the client's network conditions can support chunked responses.
|
Code » | |
The V8 codec.
|
Code » |
Returns whether or not the given error/status combination is fatal or not.
On fatal errors we immediately close the session rather than retrying the
failed request.
|
code » |
![]()
Maximum number of attempts to connect to the server for back channel
requests.
|
Code » | |
![]()
The timeout in milliseconds for a forward channel request.
|
Code » | |
![]()
When retrying for an inactive channel, we will multiply the total delay by
this number.
|
Code » | |
![]()
A LogSaver that can be used to accumulate all the debug logs so they
can be sent to the server when a problem is detected.
|
Code » | |
![]()
The maximum number of maps that can be sent in one POST. Should match
MAX_MAPS_PER_REQUEST on the server code.
|
Code » | |
![]()
A guess at a cutoff at which to no longer assume the backchannel is dead
when we are slow to receive data. Number in bytes.
Assumption: The worst bandwidth we work on is 50 kilobits/sec
50kbits/sec * (1 byte / 8 bits) * 6 sec dead backchannel timeout
|
Code » | |
![]()
A number in MS of how long we guess the maxmium amount of time a round trip
to the server should take. In the future this could be substituted with a
real measurement of the RTT.
|
Code » |
![]()
Internal enum type for the two channel types.
Constants:
|
Code » | |||||||||||
![]()
Enum type for identifying an error.
Constants:
|
Code » | |||||||||||
![]()
Enum type for the channel state machine.
Constants:
|
Code » |