客户端 - 服务器架构 [英] Client - Server architecture
本文介绍了客户端 - 服务器架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我正在进行一个项目,我必须在One WebApplication和多个客户端设备之间建立连接。现在,对于每个设备,我正在创建一个侦听该设备的线程(TcpListener对象)。这使得我在服务器上的WebApplication非常笨重。对于每个客户我都在制作一个帖子。假设100个这样的设备,那么100个线程。
还有其他方法...... ???
解决方案
是的,只需使用一个网络服务。
就是这样。
正如你提到的多个设备,所以你可以使用网络TCP绑定来进行WCF。
因为在网络TCP绑定中你可以得到一个回调。
http://msdn.microsoft.com/en-us/library/ff647180 .aspx#Step1 [ ^ ]
使用回调事件你不需要使用线程监控。 :)
Hi friends,
I am onto one project in which I have to make connection between One WebApplication and multiple Client Devices. Now for every Device I am making a thread (TcpListener object) which listens for that Device . This is making my WebApplication at server very bulky. For every client I am making one thread. Suppose if 100 such devices, then 100 threads.
Is there any other approach ...???
解决方案
Yes, just use a web service.
That is all.
Hi,
As you mentioned multiple devices, so you can go for WCF with net TCP binding.
Because in net TCP binding you can get a callback.
http://msdn.microsoft.com/en-us/library/ff647180.aspx#Step1[^]
using callback event you don''t need monitor using thread. :)
这篇关于客户端 - 服务器架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文