您的位置:首页 > 其它

[Remoting专题系列] 十:追踪服务

2007-06-05 09:11 393 查看
.NET Remoting 的追踪服务使我们可以获取由远程结构发出的有关对象与代理的行为通知。追踪服务是可插入的,我们可以将一个或多个自定义跟踪处理程序注册到追踪服务中,当发生封送、取消封送或断开当前 AppDomain 中的对象或代理时,注册到中的每个追踪处理程序都将被远程处理调用。

创建自定义追踪处理程序很简单,实现 ITrackingHandler 接口,然后调用 TrackingServices.RegisterTrackingHandler() 将其实例注册到跟踪服务即可。追踪服务一般用于日志记录和调试。TrackingServices 实用类还可以注销(TrackingServices.UnregisterTrackingHandler)追踪处理程序,或查询(TrackingServices.RegisteredHandlers)所有的已注册追踪处理程序。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using System.IO;
using System.Security.Permissions;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.CompilerServices;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Lifetime;
using System.Runtime.Remoting.Services;

namespace Learn.Library.Remoting
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐