简体   繁体   English

宾果游戏 Java 服务器架构

[英]Bingo game Java server architecture

I am planning to develop a multi-player turn based web bingo card game using Flash for client UI and java based application for server.我计划使用 Flash 客户端 UI 和 java 服务器应用程序开发基于多人回合的 web 宾果纸牌游戏。 I need to decide whether I can use Sockets from Flash to communicate with Java or web service calls from the Flash Client. I need to decide whether I can use Sockets from Flash to communicate with Java or web service calls from the Flash Client. The requirement is that we need to send the random generated bingo card data to the browser based players from server and also need to store players data to the database.要求是我们需要将随机生成的宾果卡数据从服务器发送到基于浏览器的玩家,还需要将玩家数据存储到数据库中。

Please suggest which architecture will be better like using Sockets or Web services invocation请建议哪种架构会更好,例如使用 Sockets 或 Web 服务调用

Thanks谢谢

I prefer Web services because我更喜欢 Web 服务,因为

  • not dependent on firewall rules for clients不依赖于客户端的防火墙规则
  • no need of implementing of a low level protocol (necessary for sockets)不需要实现低级协议(套接字必需)
  • XML is easier to extend in the future XML 未来更容易扩展
  • security infrastructure with HTTPS available and easy to implement具有 HTTPS 的安全基础设施可用且易于实施

You might want to look at WebSockets (part of HTML5)您可能想查看WebSockets (HTML5 的一部分)

I would suggest RESTful web service.我建议使用 RESTful web 服务。 Use socket programming is surely a bad idea.使用套接字编程肯定是个坏主意。

  1. If you implement an socket server, you'll have to deal with many of the scaling and performance issues already handled by the web servers, and session management issues too如果您实施套接字服务器,您将不得不处理 web 服务器已经处理的许多扩展和性能问题,以及 session 管理问题

  2. If you are using any port other than 80, it is quite likely be blocked by ISPs or firewalls especially cooperate firewalls.如果您使用的是 80 以外的任何端口,则很可能会被 ISP 或防火墙(尤其是配合防火墙)阻止。

But you mentioned you are using Flash, I have to remind you if you want to use web service that there is a bug which flash will only send IE cookies over even if the user is using firefox or chrome, so session management based on cookie could have problem with flash. But you mentioned you are using Flash, I have to remind you if you want to use web service that there is a bug which flash will only send IE cookies over even if the user is using firefox or chrome, so session management based on cookie could flash 有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM