Facebook Flash 游戏客户端-服务器通信
我们目前正在为 Facebook 开发一款小型独立纸牌游戏,我们希望该游戏能够(最终)吸引数十万玩家。
我们已经解决了大部分问题(可扩展性、服务器端架构等)——但是有一个问题——客户端和服务器之间的通信。服务器。
我们有以下要求:
- 服务器端推送消息(无客户端消息请求)
- 高可扩展性(最初应支持数百个,后来希望支持数千个 CCU)
- 安全、可靠的层
- 与大多数计算机、路由器和应用程序兼容。浏览器
- 与 Adobe Flash/AS3 配合使用
首先想到的是套接字连接,但我想知道是否有更好的解决方案可以满足我们的需求?
谢谢!
We're currently working on a small scale indie card game for Facebook, which we hope will reach hundreds of thousands of players (eventually).
We have most of the issues figured out (scalability, server-side architecture, etc) - however one question - communication between client & server.
We have the following requirements:
- Server side push messages (no client message request)
- High scalability (should support at first hundreds and later hopefully thousands of CCUs)
- Secure, reliable layer
- Work well with most computers, routers & browsers
- Works with Adobe Flash/AS3
First thing that came to mind was socket connections, but I was wondering, is there a better solution that answers our needs?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
套接字连接几乎是不可避免的(请参阅传输层)。
一个好主意是使用 TCP:它保证交付(高可靠性),它是面向“连接”的。虽然有一些缺点,但大多数计算机、路由器和浏览器都没有其他替代方案。
一个更重要的问题是:您要通过 TCP 发送什么?一般来说,最好使用可以在 Flash 和服务器中使用的东西(请参阅远程过程调用 例如)。
“推送”消息通常只是 HTTP 连接的问题,因为它是为处理同步请求而设计的。但是,在 Flash 中则没有此限制。
可以通过“包装” TCP 连接来添加安全性:使用 SSL 或 TLS。
请参阅 NetConnection 类和 操作消息格式。
(来自 http://www.pyamf.org/)
A socket connection is almost inevitable (see transport layers).
A good idea is to use TCP: it guarantees delivery (high reliability), it's "connection" orientated. There are some downsides, but other alternatives are not available on most computers, routers and browsers.
A more important question is: what are you going to send over TCP? Generally, it's a good idea to use something that can be used in Flash and your server (see Remote Procedure Call for example).
"Push" messages are generally only a problem with HTTP connections, as it was designed to handle synchronous requests. However, in Flash you do not have this limitation.
Security can be added by "wrapping" a TCP connection: use SSL or TLS.
See NetConnection class, and the Action Message Format.
(from http://www.pyamf.org/)
我们在 Flash 游戏中使用 WebORB 来进行服务器端和客户端的通信,但我不知道这是否足以满足您的要求。
抱歉,如果我错过了理解。
We use WebORB in our flash games for comunicating serverside and clientside but i don't know it is enough for your requirements.
Sorry if i miss understood.