For those who are interested:

We did quite extensive testing on this and we figured out that
in the onError JS Callback of a socket you can just close
the current channel and reopen a new channel with the same
channel id if error code is "0" or "-1".
This means you can spare the expensive extra new channel opening
on the server side. This especially useful for mobile websites
that loose the connection a lot.

So far we only saw google return error code 400 or 401.
When the service is down we expect 5xx error codes.

It still would be cool if someone from Google could confirm.

Cheers,
-Andrin

On Wed, Dec 14, 2011 at 10:58 AM, Andrin von Rechenberg
<[email protected]>wrote:

> Hey there
>
> We are using the Channel API heavily with mobile devices.
>
> Sometimes the onError JS Callback is called with error code 0.
> We are assuming that this is because connection was lost.
>
> If that happens, can we just call channel.open() again?
> Would the Google Service ever return code 0?
>
> At the moment our JS implementation is:
>
> function onError(error) {
>   if (error.code == 0) {
>     // No need to get a new token.
>     channel = new goog.appengine.Channel(channel_id);
>     channel.open()
>   } else {
>     // Google doesnt like this token anymore
>     requestNewChannelID();
>   }
> }
>
> We would be really screwed if Google would ever return code 0.
>
> What are possible error codes google would return?
> We also see code -1 quite often?
>
> Cheers,
> -Andrin
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to