使用远程C#聊天应用程序 [英] Chat Application using Remoting C#

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

问题描述

大家好,
我正在尝试使用.Net 2.0中的在C#中使用远程处理开发一个聊天应用程序.在我的应用程序中,我需要多个客户端彼此聊天(即,一次"n"个客户端). ).
有人可以告诉我在这种情况下服务器的作用是什么?

谢谢

Hi all...,
I am trying to develop a chat application using remoting in C# in .Net 2.0.I need in my application, multiple clients chat with each other.(i.e,''n'' clients at a time.).
Can anybody tell me what is the role of Server in this case?

Thanks

推荐答案

您有两个选择:

1.服务器应仅安排客户端连接设置(即客户端彼此之间打开连接所需的信息),以便他们可以进行点对点对话.这样做可以减轻服务器负担.我认为Skype就是这样的
2.客户端与服务器聊天,服务器将消息推送到客户端.这更易于实现,但响应时间更慢,并且负载在服务器上.

在这两种情况下,服务器还必须集中管理谁加入和退出了会话,以便在体系结构1的情况下,客户端知道谁可用,并相应地发送消息.
最后一点,我建议您了解一下该框架的较新版本. WCF可能有用.
You have two options:

1. The server should just arrange the the client connection setup (ie the information the clients need to open connection with eachother) so they can talk peer to peer. Doing this keeps the load off your server. Skype works like this I think
2. The clients chat to the server, and the server pushes the messages down to the client. This is easier to implement, but response times are slower and the load is on the server.

In either case, the server must also centralise the administration of who has joined and left the session, so that the clients know who is availble and send messages accordingly in the case of architecture 1.

As a final note, I suggest you look at getting hold of a newer version of the framework. WCF is possibly useful.


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

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