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. 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
Thanks
I prefer Web services because
- 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
- security infrastructure with HTTPS available and easy to implement
You might want to look at WebSockets (part of HTML5)
I would suggest RESTful web service. Use socket programming is surely a bad idea.
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
If you are using any port other than 80, it is quite likely be blocked by ISPs or firewalls especially cooperate firewalls.
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.
精彩评论