C#:即时消息程序 - 网络(.NET 远程处理/WCF/套接字)?
我要构建一个即时消息发送器 现在我必须决定如何实现网络。 到目前为止,我只使用套接字(TCP 或 UDP)。现在我听说了 RMI(Java 中的),并且希望在我的 C#-Chat 应用程序中也能使用它。
有.NET Remoting 和 WCF。我认为用套接字构建即时消息发送器不是一个好主意,对吗?但我应该使用那个? .NET 远程处理还是 WCF? .NET Remoting 似乎是较旧的技术,与 Java RMI 类似。我读到 .NET Remoting 比 WCT 更快(2007 年的文章)。
我的即时通讯工具应该使用哪种技术?我想从 Richtextbox 和内联图像发送格式化文本。 此外,我想在聊天客户端之间交换文件。
对于 .NET Remoting,我找到了一个教程,它使用
ChannelServices.RegisterChannel(myChan);
但这被标记为过时。 .NET Remoting 是一种过时的技术吗? 是否可以使用 WCF 或 .NET Remoting 发送图像和文件,或者套接字是更好的选择吗?
我读到 WCF 是网络技术(Web 服务、远程处理等)的集合,但如果我搜索 WCF 和远程方法调用,我只能得到 Web 服务的示例...
顺便说一句:稍后,我想实现一个 Web -我的即时消息发送器的 ASP.NET 客户端。网络(WCF/远程)是否有一些限制?
谢谢 :)
i'm going to build a instant messager
and now i have to decide how i implement the networking.
So far i only worked with Sockets (TCP or UDP). Now i heared about RMI (in Java) and want this in my C#-Chatapplication too.
There is .NET Remoting and WCF. I think building the instant messager with Sockets is not a good idea, right? But that should i use? .NET Remoting or WCF?
.NET Remoting seems to be the older technologie and is similar to Java RMI. I read that .NET Remoting is faster than WCT (article from 2007).
Which technologie should i use for my instant messager? I want to send formatted text from the richtextbox and inline images.
Furthermore i want to exchange files from chat-client to chat-client.
For .NET Remoting i found a tutorial which uses
ChannelServices.RegisterChannel(myChan);
But this is marked as obsolete. Is .NET Remoting a obsolete technologie?
Is it possible to send images and files with WCF or .NET Remoting or are Sockets the better choice?
I read that WCF is a collection of networking technologies (Web Services, Remoting, ...) but if i search for WCF and remote method invocation i only get examples for Web Services...
BTW: Later, i want to implement a Web-Client for my instant messager with ASP.NET. Are there some limitations respective to Networking (WCF/Remoting)?
Thank you :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.NET 远程处理仅用于向后兼容 自 .NET 起3.0。因此,如果您要使用 .NET 3.0 或更高版本,请使用 WCF。
为了您立即使用,我建议
NetTcpBinding< /代码>
。然后,您可以使用下图选择更合适的绑定。
。
最后,要了解 WCF,请参阅 这个 SO 问题。
.NET Remoting is maintained for backward compatibility only as of .NET 3.0. Thus, if you are going to be using .NET 3.0 or greater, use WCF.
For your immediate use, I would suggest the
NetTcpBinding
. You can then select a more appropriate binding using the following chart..
Finally, to learn about WCF, refer to this SO question.
对于您的即时消息解决方案,我建议您使用WCF P2P,这里有一篇文章可以帮助您入门使用 WCF 进行点对点编程,这里是 代码项目。
For your instant messager solution I would recommend WCF P2P here is an article to get you started Peer-to-Peer Programming with WCF and here it is an example of p2p on codeproject.