Can google app engine be used as a socket server?
Asked Answered
B

4

6

My webhost has rules against socket servers so I've been looking into GAE.

Does anyone know of a socket server that can successfully run on GAE? I'm using it for flash so anything like smartfox would be amazing if it's possible.

Thanks.

Bema answered 13/2, 2010 at 6:45 Comment(0)
T
7

Google App Engine has Channel API now

The Channel API creates a persistent connection between your application and Google servers, allowing your application to send messages to JavaScript clients in real time without the use of polling. This is useful for applications designed to update users about new information immediately. Some example use-cases include collaborative applications, multi-player games, or chat rooms. In general, using the Channel API is a better choice than polling in situations where updates can't be predicted or scripted, such as when relaying information between human users or from events not generated systematically. - taken from the link below

http://code.google.com/appengine/docs/python/channel/overview.html

Update: October 27, 2016

Channels API has been deprecated and scheduled to be turned down by 31st October, 2017

https://cloud.google.com/appengine/docs/deprecations/channel

Alternative products

You can use the Firebase Realtime Database to achieve superior realtime functionality in your application. Firebase is a more robust and customizable solution than the Channels API, and it allows communication with a broader set of clients. It currently supports Android, iOS, and apps, and web browser apps.

Timid answered 6/5, 2011 at 18:16 Comment(0)
E
6

Sockets are not supported on GAE. More supported/not supported infp here:

http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine?pli=1

Eudoca answered 13/2, 2010 at 6:49 Comment(2)
Link is dead - is this still the case?Demp
Here's the new link code.google.com/p/googleappengine/wiki/WillItPlayInJavaMarijuana
W
5

I can confirm that i have a multiplayer game using canvas/GWT/App Engine up and running using the channels api. Im using the memcache to hold the current state and have the clients report in to the server with their current state, the server will then broadcast the new state to all clients if a certain time has passed ( to keep it from sending to often if you have a high number of users ). This approach seems to take up a bunch of cpu power however, currently my approach is to have a bare minimum of logic on the server, wich means there are a lot of openings for hacks etc.. The multiplayer interaction needs some work but i have players moving within aprox a half of a seconds delay on other clients, thats also because im not showing the last known posiiton directly, im interpolating between the old position and the last known. If anyone has a better approach on how to do it on google app engine instead of using the memcache please let me know.

Warty answered 19/6, 2011 at 20:5 Comment(0)
M
3

Socket is now supported since 1.7.2 by signing up trusted tester

http://googleappengine.blogspot.com/2012/09/app-engine-172-released.html

Malemute answered 22/9, 2012 at 14:12 Comment(1)
This is outbound sockets, not inbound sockets.Vicarial

© 2022 - 2024 — McMap. All rights reserved.