如何构建网络/客户端支持聊天系统

发布于 2024-10-05 12:02:59 字数 550 浏览 0 评论 0原文

我希望为我们公司的一个网站建立一个在线客户支持系统,并对结构有一些疑问。

场景是这样的。我们希望我们网站的用户能够单击“实时聊天支持”按钮,此时他们会看到一个弹出窗口,尝试将他们连接到我们的支持团队之一。

另一方面,我们的支持团队将运行桌面客户端。每当我们网站上的用户单击该链接时,所有桌面客户端都会“响铃”。每当支持团队成员“接听”呼叫时,其他客户端就会停止响铃,并且该成员将开始与网络用户聊天。

鉴于我们的桌面客户端将使用 C#.NET 中的 WPF 制作,并且我们的站点是 ASP.NET MVC 2 - 在两者之间建立通信的最佳方式是什么?

我最初的想法是让 Web 端将聊天存储在 SQL 数据库中,并以某种方式“Ping”相关桌面客户端,告诉它更新其聊天日志。对于桌面到网络也是如此。但我不确定如何在两个不同的平台之间实现这一点。如果是桌面客户端到桌面客户端,我想这会容易得多,但事实并非如此。

另外,请记住,我意识到已经有商业应用程序可以做到这一点。然而,我们需要一些超出简单聊天范围的定制功能 - 不值得讨论细节,但基本上我们必须实现我们自己的解决方案。

非常感谢任何帮助。

I am looking to build an online customer support system for one of our company sites and had a few queries with regards to the structuring.

The scenario is this. We would like users of our site to be able to click a "Live Chat Support" button, at which point they would get a popup that tries to connect them to one of our support team.

Our support team on the other hand, will be running desktop clients. Whenever a user on our site clicks the link, all of the desktop clients will "ring". Whenever a support team member "answers" the call, the other clients will stop ringing and that member will begin chatting with the web user.

Given that our desktop client will be made using WPF in C#.NET and our site is ASP.NET MVC 2 - what would be the best way to establish communication between the two?

My initial thoughts were to have the web side store the chat in an SQL database and somehow "Ping" the relevent desktop client telling it to update its chat log. Similarly for the desktop to the web. But I am unsure how to go about implement this between two different platforms. If it were desktop client to desktop client I imagine it would much easier, but this is not the case.

Also, please bare in mind that I realise there are already commercial applications out there that do this. However, we require some bespoke functionality that goes beyond a simple chat - it is not worth going into the specifics but basically we must implement our own solution.

Any help is much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦亿 2024-10-12 12:02:59

Web技术是一个不适合实现实时交互的平台。当然这是可以做到的,但是您肯定会遇到可扩展性、响应能力和开发工作量方面的问题。我强烈建议您仔细检查您的需求,并考虑是否有可能利用供应商的产品来完成您想要做的事情。

如果您仍然想自己创业,那么您必须克服的主要障碍是如何将消息推送到浏览器。使用纯 Web 技术从服务器“Ping”浏览器是不可能的,因为 HTTP 是建立在“仅拉”请求/响应模型之上的。客户端与服务器之间不保持持久连接。服务器完成向浏览器发送页面后,连接就消失了。

您可以轮询 Web 服务器以获取新消息,但这不是一个可扩展的解决方案。如果您只处理非常少量(例如个位数)的用户,那么这可能会起作用,但是您的响应能力将受到轮询速度的限制,并且轮询速度越快,该解决方案的可扩展性就越差是。

更好的解决方案是使用 Silverlight、Flash 或在浏览器中运行的其他一些胖客户端技术。然后,您可以实现一个处理客户端之间的消息路由的服务。 这篇关于 CodeProject 的文章可能是一个不错的起点。

Web technology is an inappropriate platform for implementing real-time interaction. It can be done, of course, but you will certainly have issues with scalability, responsiveness and development effort. I urge you to examine your requirements very carefully and consider whether it is at all possible to leverage a vendor product to accomplish what you want to do.

If you still want to strike out on your own, the main hurdle you will have to overcome is how to push messages to the browser. "Pinging" the browser from the server is impossible using pure web technologies, because HTTP is built on a "pull-only" request/response model. There is no persistent connection maintained between the client in the server. After the server has finished sending the page to the broswer, the connection is gone.

You could poll the web server for new messages, but this is not a scalable solution. If you're only dealing with a very small (say single digits) number of users, then this might work, but your responsiveness will be limited by the speed at which you poll, and the faster you poll, the less scalable this solution will be.

A better solution would be to use Silverlight, Flash, or some other thick-client technology running in the browser. Then you could implement a service that handles message routing between clients. This article on CodeProject might be a good place to start.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文