资源简介
OPC 基金组织公开的最新OPC Server 4.0 for .NET,是开发OPC难得的开源项目
代码片段和文件信息
/**********************************************************************
* Copyright © 2009 2010 2011 2012 OPC Foundation Inc.
*
* The source code and all binaries built with the OPC .NET 3.0 source
* code are subject to the terms of the Express Interface Public
* License (Xi-PL). See http://www.opcfoundation.org/License/Xi-PL/
*
* The source code may be distributed from an OPC member company in
* its original or modified form to its customers and to any others who
* have software that needs to interoperate with the OPC member‘s OPC
* .NET 3.0 products. No other redistribution is permitted.
*
* You must not remove this notice or any other from this software.
*
*********************************************************************/
using System;
using System.ServiceModel;
namespace Xi.Common.Support
{
///
/// This class is used to properly close a WCF client proxy. It aborts or closes
/// the proxy based on the channel status and whether an exception is encountered.
/// It has two calling methods one where the proxy has a short life and the other
/// to be used when the proxy is held over the life of a single method.
///
///
/// Usage 1: Short lived proxy
/// void SomeMethod()
/// {
/// SomeWcfProxy proxy = new SomeWcfProxy();
/// using (new ChannelCloser(proxy))
/// {
/// proxy.MakeCall();
/// ...
/// }
/// }
///
/// Usage 2: Long lived proxy
/// void CreateProxy()
/// {
/// SomeWcfProxy proxy = new SomeWcfProxy();
/// ...
/// }
/// void DestroyProxy()
/// {
/// ChannelCloser.Close(proxy);
/// }
///
public class ChannelCloser : IDisposable
{
private readonly ICommunicationobject _channel;
///
/// Constructs a WCF channel closer object
///
/// WCF proxy object
public ChannelCloser(object channelObj)
{
if (!(channelObj is ICommunicationobject))
throw new ArgumentException(“Channel object must implement ICommunicationobject“);
_channel = (ICommunicationobject)channelObj;
}
///
/// Properly releases and closes the held WCF proxy
///
public void Dispose()
{
Close(_channel);
}
///
/// This method closes the passed proxy object
///
///
public static void Close(object obj)
{
if (obj != null)
{
var channelObj = obj as ICommunicationobject;
if (channelObj == null)
throw new ArgumentException(“Channel object must implement ICommunicationobject“ “obj“);
// if the channel faults you cannot Close/Dispose it - instead you have to Abort it
if (channelObj.State == CommunicationState.Faulted)
channelObj.Abort();
else if (channelObj.State != CommunicationState.Closed)
{
try
{
channelObj.Close();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-09-06 15:02 Xi Contracts\Data\
文件 2551 2012-09-06 11:33 Xi Contracts\Data\AddDataob
文件 3106 2012-09-06 11:33 Xi Contracts\Data\AlarmCondition.cs
文件 2444 2012-09-06 11:33 Xi Contracts\Data\AlarmDesc
文件 1479 2012-09-06 11:33 Xi Contracts\Data\AlarmEnabledState.cs
文件 2377 2012-09-06 11:33 Xi Contracts\Data\AlarmMessageData.cs
文件 2245 2012-09-06 11:33 Xi Contracts\Data\AlarmState.cs
文件 4931 2012-09-06 11:33 Xi Contracts\Data\AlarmSummary.cs
文件 1410 2012-09-06 11:33 Xi Contracts\Data\AliasAndCalculation.cs
文件 2115 2012-09-06 11:33 Xi Contracts\Data\AliasResult.cs
文件 1957 2012-09-06 11:33 Xi Contracts\Data\AliasUpdate.cs
文件 3374 2012-09-06 11:33 Xi Contracts\Data\CategoryConfiguration.cs
文件 1924 2012-09-06 11:33 Xi Contracts\Data\DataJournalOptions.cs
文件 1402 2012-09-06 11:33 Xi Contracts\Data\DataJournalWriteResult.cs
文件 16674 2012-09-06 11:33 Xi Contracts\Data\DataValueArrays.cs
文件 11523 2012-09-06 11:33 Xi Contracts\Data\DataValueArraysWithAlias.cs
文件 4455 2012-09-06 11:33 Xi Contracts\Data\EndpointConfiguration.cs
文件 2419 2012-09-06 11:33 Xi Contracts\Data\EndpointConfigurationEx.cs
文件 3071 2012-09-06 11:33 Xi Contracts\Data\EndpointDefinition.cs
文件 6029 2012-09-06 11:33 Xi Contracts\Data\ErrorInfo.cs
文件 2870 2012-09-06 11:33 Xi Contracts\Data\EventId.cs
文件 1436 2012-09-06 11:33 Xi Contracts\Data\EventIdResult.cs
文件 4744 2012-09-06 11:33 Xi Contracts\Data\EventMessage.cs
文件 2206 2012-09-06 11:33 Xi Contracts\Data\EventMessageField.cs
文件 3677 2012-09-06 11:33 Xi Contracts\Data\EventType.cs
文件 4774 2012-09-06 11:33 Xi Contracts\Data\FilterCriterion.cs
文件 3792 2012-09-06 11:33 Xi Contracts\Data\FilterSet.cs
文件 3201 2012-09-06 11:33 Xi Contracts\Data\FindCriteria.cs
文件 14513 2012-09-06 11:33 Xi Contracts\Data\InstanceId.cs
文件 2378 2012-09-06 11:33 Xi Contracts\Data\JournalDataChangedValues.cs
文件 1799 2012-09-06 11:33 Xi Contracts\Data\JournalDataPropertyValue.cs
............此处省略164个文件信息
相关资源
- wtopcsvr.dll使用手册
- OPCProxy.dll等相关支持库
- arcgis server 10.2.2 许可文件
- arcgis10.3.1正式版完整版包含desktop+se
- Netzob官网的server以及client
- rhel-server-7.0-x86_64-dvd
- Windows Server 2012 R2 Active Directory配置指
- taotao_image_server_133淘淘商城15年视频的
- winserver2008/iis7缓冲区溢出提权0day
- 最小的DHCP服务器软件dhcpsrv1.7.rar
- server 2008 r2 +exchange 2010
- vSphere6、vCenterServer6许可证生成器(打
- opc NET API
- 《开源软核处理器OpenRisc的SOPC设计》
- Wtopcsvr9.0带注册号
- OPC组件注册包
- 三菱OPC服务软件序列号
- win10 telnetserver
- SharePoint Server 2016 Enterprise Key
- Centos 搭建crtmpserver流媒体服务器
- IBM DATA SERVER DRIVER FRO ODBC CLI/DB2 Driver使
- PhotoshopCC2019入门到精通视频教程.txt
- Team Foundation Server 2017 & SharePoint Serve
- 在 Window Server 2008 上部署web系统
- SLE-12-SP1-Server-DVD-x86_64-GM-DVD1
- qt TCP网络编程与聊天室的实现
- IEDriverServer_x64
- OPC客户端测试软件
- Citrix XenServer 6.0 用户永久
- IEDriverServer3.0 (64位)
评论
共有 条评论