channel-api

RTCDataChannel with Google Channel API

断了今生、忘了曾经 提交于 2020-06-29 10:02:40
问题 I'm trying to follow this example by Dan Ristic for RTCDataChannel browser p2p communication with Google's Channel API for signaling. It seems to be failing silently - I can't get the RTCDataChannel.onopen , RTCPeerConnection.onicecandidate , or RTCPeerConnection.ondatachannel events to fire. Client JS/HTML: <html> <head> <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> <script type="text/javascript" src="/_ah/channel/jsapi"></script> <script> $(document).ready(function(){

Force Channel API to poll

随声附和 提交于 2020-01-02 03:37:06
问题 Hopefully Moishe sees this: in development mode, the channel api client (javascript) resorts to polling... and uses a very fast polling rate. After poking around I found that if I set goog.appengine.Socket.POLLING_TIMEOUT_MS = interval; I can control the polling rate. What I'm wondering is: How do I know if/when the client is going to go into "poll mode" in production? Is it possible to force the client into "poll mode"? What happens if I reach the channel quota for my app? will the /_ah

Implement Comet / Server push in Google App Engine in Python

ぐ巨炮叔叔 提交于 2019-12-31 10:30:37
问题 How can I implement Comet / Server push in Google App Engine in Python? 回答1: We just announced the Channel API to do comet push with App Engine apps: http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html If you're at Google IO, I'll be talking about this at 1pm tomorrow (on the APIs track): http://code.google.com/events/io/2010/sessions/building-real-time-apps-app-engine-feed-api.html Here's the YouTube video of the session: http://www.youtube.com/watch?v=oMXe-xK0BWA

Sitebricks and Channel Presence Service (GAE); Also having trouble with normal servlets

南楼画角 提交于 2019-12-25 05:25:15
问题 In my Java Google App Engine server application, I would like to enable Channel Presence servlets in order to track connections/disconnections to/from my channels using the Channel API (as described here. I have already edited my WEB-INF/appengine-web.xml file like described. Most servlets in my application use Sitebricks , instead of classes extending HttpServlet, to provide an easy way for me to create REST endpoints in my app. BUT, it seems like using Sitebricks in my class, like so, does

Is it OK to pass both token and client_id to the client when Channel API is used?

谁都会走 提交于 2019-12-24 08:17:42
问题 I need to create an application, where GAE server will always talk with just one client (i.e. one message should be always sent just to one client). I do the following - Python: def get(self): # generate token, when page is loaded client_id = uuid.uuid4().hex token = channel.create_channel(client_id) template_values = {'token': token, 'client_id': client_id } self.response.out.write(template.render('page.html', template_values)) def post(self): # reply to the client ... client_id = self

When is it better to use polling instead of the channel api?

陌路散爱 提交于 2019-12-24 00:08:52
问题 I have an application where users can collaborate on photo albums. I currently use polling on the client to check for new content every 30 seconds. There can be any number of people uploading and viewing an album at any given time. On the server side, I cache the data to return (so the query for new content is cheap). I assume that polling every 30 seconds from multiple clients will cause more instances to stay active (and thus increase costs). Would it be overkill to use the channel api for

Google App Engine Channel API

大憨熊 提交于 2019-12-20 10:26:26
问题 I am trying to learn GAE's channel API (using Java), but I cannot figure out where to start from. I went through Channel API Overview (Java) but the code posted there wasn't complete for brevity purposes. And since I m newbie, it would be very helpful if complete example code is available. Thanks, Shrey 回答1: The code in the Channel API Overview that you've linked to is pretty complete, it's just a bit all over the place. I will admit, once you understand it, I feel like it's much simpler than

JavaScript Argument not passed across handler

非 Y 不嫁゛ 提交于 2019-12-13 08:11:39
问题 I am using Google Cloud Channels in Android's WebView, but the same problem probably occurs as well when using any socket in a similar way. Problem: The argument is not passed on by the handler, possibly because functions are called in a different scope. Here is my code: <html> <head> <script src='{{ channelurl }}jsapi'></script> </head> <body> <script type="text/javascript"> onMessage = function(message) { }; var token = '{{ token }}'; var channel = new goog.appengine.Channel(token); var

GAE Channel API : connection doesn't open on Android browser

依然范特西╮ 提交于 2019-12-13 06:41:25
问题 I'm testing Channel API in a basic test project. When Using chrome on desktop, the connection opens (an alert window appears) But when using android browser, the connection doesn't open, nothing happens. Actually, it has worked two or three times, but just the connection; and now, nothing. Below the code. <html> <head> <script src='/_ah/channel/jsapi'></script> </head> <body> <script type="text/javascript"> initialize = function() { var chat_token = '<%=request.getParameter("token")%>'; var

How to implement delay in GAE replies?

陌路散爱 提交于 2019-12-12 10:19:28
问题 Once I've got a message from the client, I don't want to reply immediately, I want to wait for a few seconds ( random number of seconds). How can I do it? (I use Channel API, so such delay should be OK for the client) 回答1: You can just make the thread sleep for a while: import thread ... thread.sleep(some_number_of_milliseconds) 回答2: The deferred built-in library would perform better than sleep for App Engine and is easier to setup than Task Queue. [https://cloud.google.com/appengine/articles