<>载体>Important note:
我已在服务器Fault上询问这个问题:https://serverfault.com/questions/349065/clustering-tcp-servers-so-can-send-data-to-all-clients,但我也希望看到。
www.un.org/Depts/DGACM/index_spanish.htm
I m developing a real-time mobile app by setting up a TCP connection between the app and server backend. Each user can send messages to all other users.
http://aws.amazon.com/“rel=“nofollow noreferer”>Twisted,正在制作我自己的通讯程序,在Amazon Web Services。
www.un.org/Depts/DGACM/index_spanish.htm Currently I m trying to make the backend scalable (and reliable). As far as I can tell, the system could cope with more users by upgrading to a bigger server (which could become rather limiting), or by adding new servers in a cluster configuration - i.e. having several servers sitting behind a load balancer, probably with 1 database they all access.
I have sketched out the rough architecture of this:
然而,如果红新用户向所有其他相关用户发出信息,又怎么办? 红色服务器与红外线连接,但与绿化无关。
我可以想办法解决这一问题:
- Each server could have an open TCP (or SSL) connection with each other server. When one server wants to send a message to all users it simply passes this along it s connection to the other servers. A record could be kept in the database of which servers are online (and their IP address), and one of the servers could be a boss - i.e. decides if others are up and running, if not it could remove them from the database (if a server was up and lost it s connection to the boss it could check the database and see if it had been removed, and restart if it had - else it could assume the boss was down.)
Clearly this needs refinement but shows the general principle.
否则,我不敢肯定这一点(我当然似乎喜欢想):
- Perhaps users could just connect to a box or router, and all servers could message all users through it?
www.un.org/Depts/DGACM/index_spanish.htm
如果你知道如何有效地集中TCP服务器,或提供解决办法的设计模式,或根本没有评论,那么我将非常感谢。 感谢: