如何自定义聊天应用程序 [英] How to customize chat application

查看:110
本文介绍了如何自定义聊天应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义聊天应用程序,可以从Windows和Web应用程序访问。



这是场景



聊天部分将有两部分,一部分在网络中,另一部分在Windows中。

从网络上,用户可以加入聊天。每个Web浏览器只有一个聊天窗口,从Web用户登录后,将在Gtalk等Windows聊天应用程序中看到。



所以桌面用户可以聊天多个网络用户,而网络用户只能与单个桌面用户聊天。



有谁能指导我如何进入这个?

提前谢谢。

解决方案

这是一个大问题,因为你从浏览器中的Web应用程序的要求开始,原因很明显:HTTP协议提出了很多限制,它是无国籍的,等等。



如果以Web应用程序为主要目标实现这一目标,那么添加Windows应用程序作为客户端部分会更容易,因为这些应用程序更灵活,他们可以做任何浏览器可以做的事情,以及更多。您可以完全模拟浏览器和基于浏览器的客户端应用程序的行为。特别是,如果您使用.NET,您可以使用类 System.Net.HttpWebRequest ,它可以完成您使用HTTP所需的一切:

http://msdn.microsoft.com/en-us/library/system.net .httpwebrequest.aspx [ ^ ]。



对于聊天,HTTP限制的一个最大问题是其客户端 - 服务器性质,这使得Web应用程序仅限于拉技术。请参阅:

http://en.wikipedia.org/wiki/Pull_technology [< a href =http://en.wikipedia.org/wiki/Pull_technologytarget =_ blanktitle =New Window> ^ ],

http://en.wikipedia.org/wiki/Push_technology [ ^ ]。



对于聊天,添加推送技术,或服务器推送(请参阅上面引用的文章),将提供基本的好处,因为它可以帮助您摆脱聊天客户端定期发布服务器。我建议关注ASP.NET SignalR提供的这个问题的解决方案:

http://signalr.net/ [ ^ ]。



不幸的是,您没有与我们分享您可以访问哪些服务器端Web技术;而且,如果没有这个,我的建议的适用性可能会受到限制。我只想指出,利用基于.NET的技术可以带来很多好处。下次,尝试提供更多信息。



祝你好运,

-SA

I want to create a customize chat application which can be accessed from both windows and web application.

Here is the scenario

There will be two part in the chat section one is in web another one is in windows.
From the web, user can join in the chat. There is only one chat window for each web browser, after logged in from web user will be visible in the windows chat application like Gtalk.

So desktop user can chat multiple web user at a time whereas web user can chat only with the single desktop user.

Can anyone please guide me how to move into this?
Thanks in advance.

解决方案

This is not a big problem is you start from the requirements of a Web application working through the browsers, for apparent reasons: HTTP protocol put a lot of limitations, it's stateless, and so on.

If this is achieved having the Web application as the primary goal, adding a Windows application as the client part will be much easier, because those applications are way more flexible, they can do absolutely everything what browsers can do, and a lot more. You can fully simulate the behavior of the browser and browser-based client-side application. In particular, if you use .NET, you could use the class System.Net.HttpWebRequest which can do all you need to work with HTTP:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

For the chat, one biggest problem of the HTTP limitation is its client-server nature, which makes Web application limited to pull technology. Please see:
http://en.wikipedia.org/wiki/Pull_technology[^],
http://en.wikipedia.org/wiki/Push_technology[^].

For the chat, the addition of push technology, or the server push (please see the article referenced above), would present the fundamental benefit, as it can help you to get rid of regular posting of the server by the chat clients. I would advice to pat attention for the solution of this problem offered by ASP.NET SignalR:
http://signalr.net/[^].

Unfortunately, you did not share with us what server-side Web technologies are accessible to you; and, without that, the applicability of my advice could be limited. I just would like to note that leveraging of .NET based technologies would give you some great benefits. Next time, try to provide more information with your questions.

Good luck,
—SA


这篇关于如何自定义聊天应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆