发布/订阅架构 [英] Pub/Sub architecture

查看:175
本文介绍了发布/订阅架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着写一个发布/订阅系统(客户端和服务器端),其中客户端接收定期更新(如心跳,消息控制),并可以发出命令服务器(订阅一些源代码,....)。

I try to write a pub/sub system ( client and server side ) , where client receives regular updates ( like heartbeat, message control ) and can issue command to server ( subscribe to some source , .... ).

什么是做一个好办法?我已经在服务器实现线程池来管理传入的客户端连接。

What would be a good way to do that? I have already a server implementing a threadpool to manage incoming client connection.

我不知道如何处理的事实,连接的两侧可以读取或写入的数据的NetworkStream。此外更我的客户实际上将发布到服务器极少数的命令(主要是订阅一些数据,然后就得到定期更新)。
我尝试尽量使用普通插座,TcpClient的,tcplistner(我会在后面看到有关WCF)

I was wondering how to handle the fact the both side of the connection can read or write data in the NetworkStream . Furthermore more of my clients will actually issue very few commands to the server ( mostly to subscribe to some data and then just get regular updates ). I try try to use plain socket,tcpclient,tcplistner ( i ll see later about WCF )

THX
戴夫

Thx Dave

推荐答案

或什么的自由,就像使用MSMQ和WCF发布订阅。

Or something free, like pubsub using MSMQ and WCF.

http://dotnetslackers.com/CSharp/re-108306_Building_a_Pub_Sub_Message_Bus_with_WCF_and_MSMQ.aspx

这篇关于发布/订阅架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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