开发者

Tic Tac Toe AppEngine Channel sample mechanics

Greetings gents,

EDIT: forgot the link to the sample, here it is: http://code.google.com/p/java-channel-tic-tac-toe/source/browse/trunk/src/com/google/appengine/demos/channeltactoe/

So i'm studying the channel API of AppEngine and i stumbled onto a question regarding the way it's architecturally coded. They way i perceive it works is the clients send standard POST requests, the game gets updated and the both players get the update through the ChannelService a JSON message.

Now i read on the javadoc that Channel is a two-way communication channel, so why did this developer go for the POST servlets(for game-updates) and Channel for distribution instead of using a single servlet for the sole creation of the Channel and then using that channel for front and back game updates communication between the client and server?

To summerize, what did does this architecture gain over using a true 2-way channel, or is it even possible to use the 2-way(back to server channel) in that way.

Thank you for reading, i hope m开发者_如何学Cy question is valid/understandable.

-Rohan


I don't know where you read that Channels are bi-directional; they're not. Channels are solely for sending messages from the server to the client. Client communications have to utilize standard HTTP requests.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜