当前注册人数423000人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

WCF: Duplex Operations and UI Threads

WCF:Duplex消息交换实现客户/服务器通信及UI线程示例演示程序

2008年05月17日
C# 2.0, C#, Windows, .NET, .NET 3.0VS, VS2005, Dev
简单的说Duplex实现了客户端与服务端双向通信的功能,在服务器端定义个通信,可以指定一个Callback回调函数,可以通过客户端激活。附件的程序中,每当有客户端连接等消息的时候,都以事件更新到界面上。
相关知识

Simply put, duplex operations provide a mechanism for allowing a service to callback to the client. When a contract is defined for a service, it is possible to specify a corresponding callback contract. The standard service contract defines the operations of the service that can be invoked by the client. The callback contract defines the operations of the client that can be invoked by the service. It is the client's responsibility to implement the callback contract and host the callback object. Each time the client invokes a service operation that is associated to the callback contract, the client supplies the necessary information for the service to locate and invoke the callback operation on the client.

One of the most popular uses for duplex operations seems to be for events. This is typically accomplished by using a publish-subscribe pattern. One or more clients will subscribe to the service. When something of interest occurs, the service will publish the information to the subscribed clients.

This is the approach used by the demo. It is based on the concept of assisting the host of a party by tracking guests and their consumption of beer. Although intentionally humorous, it effectively illustrates the key concepts involved with duplex operations. Each guest subscribes to the service by joining the party. When something interesting happens, such as other guests joining/leaving the party as well as the consumption of beer, the service publishes the information to the subscribed clients.
 

源代码原文下载:
WCF: Duplex Operations and UI Threads This article examines how duplex operations are implemented in WCF as well as some of the issues that may arise when dealing with UI threads.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载632次)

最值得关注的外文源代码

WCF / WPF Chat Application
Getting Around InvokeRequired Without Copy and Paste
DrawMe - A network ink-chat application exploring .NET 3.5, WPF and WCF
WCF / WPF Chat Application
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论76次,此处显示最近20次评论! 查看所有评论

lyt696  2015年02月15日
谢谢分享。
whhack  2014年09月05日
我要下载!
Kerry  2014年07月29日
学习一下
周小舟  2014年04月28日
学习一下。
suysulin  2014年01月07日
资源不错,值得学习
xzmm2000  2012年09月22日
还行啊
sdm3615  2012年08月15日
谢谢这个资源,需要这样的代码学习!
abweixx  2012年07月31日
谢谢!
ot7652  2012年07月13日
谢谢好资源
等待打破  2012年04月20日
学习了
风一样的人  2012年03月28日
不错 很好
xxx  2012年03月15日
有价值。
604332640  2011年11月01日
不错,学习必备良药!
fzuzxb  2011年10月27日
还行啊
fuxiangno1  2011年10月26日
三人行必有我师
xdongwei  2011年10月14日
学习一下
as4412  2011年09月22日
学习一下
haven  2011年08月05日
不错,学习必备良药!
小罗  2011年06月04日
fff
jelly  2011年04月29日
谢谢 非常好
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明