A bit more advanced: Load balancing a chat server.
稍微高级一点的主题:聊天服务器的负载平衡。
A chat server allows multiple clients to connect to it.
一个聊天服务器允许多个客户端连接到它。
Since HTTP is a request-response protocol, the chat server cannot push new messages to the client.
因为HTTP是一个请求-响应协议,所以聊天服务器不能把新消息发给客户。
If you are broadcasting messages and your socket server is running on another host, you should set the broadcast clients option to the chat server IP.
如果正在广播消息,而同时socket服务器运行在另一个主机之上,那么就应该将广播客户机选项设置为此chat服务器IP。
In less than 20 lines of code (actually, there are only eight that are doing anything), you have built a functional chat server. Here is the flow of this simple program.
在不到20行代码中(实际上,真正实现功能的代码只有8行),您已经构建了一个能够使用的聊天服务器。
Explain how you would design a chat server in particular, provide details about the various backend components, classes, and methods What would be the hardest problems to solve?
7在提供了后台的各种部件,类和方法的细节后,你如何设计一个聊天服务程序?最难解决的问题是什么?
Now let's walk through the code and explain how the example fulfills the defined expectation of what a chat server is and does. The first line allows access to the contents of the net module.
现在,让我们检查所有代码,并解释这个例子如何实现聊天服务器预定功能。
This chat server is pretty simple. It is so simple that it is lacking some very basic features such as an identification of who sent each message or handling the case where a client disconnects.
这个聊天服务器十分简单,它缺少一些非常基础的功能,比如识别是谁发送哪条消息,或者处理某个客户端断开的情况。
In this article I show you how to build a chat application with both server and client components.
本文将向您介绍如何利用服务器和客户端组件构建一个聊天应用程序。
The Group List Server could be integrated with other services to facilitate activities, such as creating an instant message buddy list, managing chat groups, or hosting an e-meeting session.
GroupListServer可以与其他服务集成,以促进各种活动的进行,如创建即时消息好友列表、管理聊天组或发起电子会议会话。
Before you can voice chat with your Sametime contacts, your Lotus Sametime server must allow voice chats.
在与Sametime联系人进行语音聊天之前,Lotus Sametime服务器必须允许语音聊天。
Each time a client tries to connect to the chat, the Flash client will request the policy authorization to the server.
每当客户机试图连接到此聊天时,Flash客户机都将会向此服务器请求策略授权。
On the server side, a chat channel is really just a SimSet - a simple collection of objects, in this case client IDs.
在服务器端,一个聊天通道只是一个SimSet(一个简单的对象集合),这里即客户机id。
You must ensure that chat clients can establish a permanent connection to the socket server to listen for chat messages.
为了侦听聊天消息,必须确保聊天客户机能够建立与此socket服务器的永久连接。
Facebook chat provides an example of an interesting problem with AJAX: pushing data from server to client.
Facebook聊天功能提供了关于AJAX一个有意思的问题案例:把数据从服务器端推送到客户端。
This is accomplished by installing and using a Flash - (client-side) and Ruby - (server-side) based socket connection to let chat clients permanently pull updates from the server.
为了实现此目的,可以安装并使用一个基于Flash(客户机端)和Ruby(服务器端)的socket连接以使chat客户机能永久地从服务器获取更新。
In a chat application, I can see how this works, since the server is being fed new messages all the time.
在聊天中,我可以看到它是如何工作的,因为服务器是美联储新信息的时间。
The user can establish several connections to different servers at the same time. For example, the user can connect to a normal game server, and another server for voice chat.
用户可以同时建立多个连接与多个服务器同时进行通信,比如除了连接常规的游戏服务器,还可以连接语音聊天服务器。
Multi-client chat using TCP system (1) server, multiple clients can connect to the server, note that the client can also enter a nickname.
利用TCP实现多客户聊天系统 (1)服务器运行,多个客户端都能够连接到服务器,注意,客户端还可以输入昵称。
It was added that in addition to being able to chat with friends, you will also probably be able to check server status and see which servers are up.
另外为能和朋友交流,你也可能可以检查服务器的状态看看那个在运行。
This is a Survival MultiPlayer server, interact with others! Share resources and knowledge you have, we are all friendly and helpful. Be active and polite in chat, and build with others!
这是个多人生存服务器,请多与他人互动,请尽量与他人分享你的资源,我们都很友好并很乐意帮助你请注意交谈时的措词,也请尽量和你的朋友们一起建造。
This is a Survival MultiPlayer server, interact with others! Share resources and knowledge you have, we are all friendly and helpful. Be active and polite in chat, and build with others!
这是个多人生存服务器,请多与他人互动,请尽量与他人分享你的资源,我们都很友好并很乐意帮助你请注意交谈时的措词,也请尽量和你的朋友们一起建造。
应用推荐