ChannelServices ChannelServices ChannelServices ChannelServices Class

定义

提供帮助进行远程处理信道注册、解析和 URL 发现的静态方法。Provides static methods to aid with remoting channel registration, resolution, and URL discovery. 此类不能被继承。This class cannot be inherited.

public ref class ChannelServices sealed
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ChannelServices
type ChannelServices = class
Public NotInheritable Class ChannelServices
继承
ChannelServicesChannelServicesChannelServicesChannelServices
属性

注解

信道传输此类作为应用程序域、 进程和计算机的远程处理边界跨应用程序之间的消息。Channels transport messages between applications across such remoting boundaries as application domains, processes, and computers. 这些交叉可以是入站和出站。These crossings can be inbound and outbound. 通道可以侦听终结点上的入站消息,将发送到和 / 或出站消息的终结点。A channel can listen on an endpoint for inbound messages, send to an endpoint for outbound messages, or both. 这提供了各种协议,插入的运行时中的扩展点,即使在运行时可能不是在另一端的通道。This provides an extensibility point in the runtime to plug in a wide range of protocols, even though the runtime might not be at the other end of the channel. 运行时对象可用于公开各种语义和实体。Run-time objects can be used to expose a wide range of semantics and entities. 频道提供扩展性点以与特定的协议转换消息。The channel provides the extensibility point to convert the messages to and from the specific protocols.

信道必须公开IChannel接口,提供信息性的属性,例如ChannelNameChannelPriorityChannels must expose the IChannel interface, which provides informational properties such as the ChannelName and ChannelPriority. 使用注册通道ChannelServices.RegisterChannel方法。Channels are registered using the ChannelServices.RegisterChannel method. 此外可以从远程处理配置加载通道。Channels can also be loaded from the remoting configuration. (请参阅<通道 > 元素 (模板)有关详细信息。)(See <channel> Element (Template) for details.)

在客户端,消息传递到客户端信道接收器链后经过客户端Context链。On the client side, messages are handed off to the client channel sink chain after they traverse the client Context chain. 第一个信道接收器通常是IClientFormatterSink,其中将消息序列化到信道接收器链中向下传递到客户端传输接收器的流。The first channel sink is typically a IClientFormatterSink, which serializes the message into a stream that is passed down the channel sink chain to the client transport sink. 然后客户端传输接收器将此流写出到网络。The client transport sink then writes this stream out to the wire.

在服务器端,服务器传输接收器读取网络请求,并将请求流传递到服务器信道接收器链。On the server side, the server transport sink reads requests off the wire and passes the request stream to the server channel sink chain. 此链末尾处的服务器格式化程序接收器将该请求反序列化为消息。The server formatter sink at the end of this chain will deserialize the request into a message. 它将然后将此消息提交给远程处理基础结构,这将其调度到服务器Context链。It will then hand this message off to the remoting infrastructure, which will dispatch it to the server Context chain.

属性

RegisteredChannels RegisteredChannels RegisteredChannels RegisteredChannels

获取当前已注册信道的列表。Gets a list of currently registered channels.

方法

AsyncDispatchMessage(IMessage, IMessageSink) AsyncDispatchMessage(IMessage, IMessageSink) AsyncDispatchMessage(IMessage, IMessageSink) AsyncDispatchMessage(IMessage, IMessageSink)

根据嵌入在消息中的 URI 将给定的消息异步调度到服务器端链。Asynchronously dispatches the given message to the server-side chain(s) based on the URI embedded in the message.

CreateServerChannelSinkChain(IServerChannelSinkProvider, IChannelReceiver) CreateServerChannelSinkChain(IServerChannelSinkProvider, IChannelReceiver) CreateServerChannelSinkChain(IServerChannelSinkProvider, IChannelReceiver) CreateServerChannelSinkChain(IServerChannelSinkProvider, IChannelReceiver)

为指定的信道创建信道接收器链。Creates a channel sink chain for the specified channel.

DispatchMessage(IServerChannelSinkStack, IMessage, IMessage) DispatchMessage(IServerChannelSinkStack, IMessage, IMessage) DispatchMessage(IServerChannelSinkStack, IMessage, IMessage) DispatchMessage(IServerChannelSinkStack, IMessage, IMessage)

调度传入的远程调用。Dispatches incoming remote calls.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetChannel(String) GetChannel(String) GetChannel(String) GetChannel(String)

返回具有指定名称的注册信道。Returns a registered channel with the specified name.

GetChannelSinkProperties(Object) GetChannelSinkProperties(Object) GetChannelSinkProperties(Object) GetChannelSinkProperties(Object)

返回给定代理的属性的 IDictionaryReturns a IDictionary of properties for a given proxy.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetUrlsForObject(MarshalByRefObject) GetUrlsForObject(MarshalByRefObject) GetUrlsForObject(MarshalByRefObject) GetUrlsForObject(MarshalByRefObject)

返回所有可用于到达指定对象的 URL 的数组。Returns an array of all the URLs that can be used to reach the specified object.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterChannel(IChannel) RegisterChannel(IChannel) RegisterChannel(IChannel) RegisterChannel(IChannel)

向信道服务注册信道。Registers a channel with the channel services. RegisterChannel(IChannel) 已过时。RegisterChannel(IChannel) is obsolete. 请改用 RegisterChannel(IChannel, Boolean)Please use RegisterChannel(IChannel, Boolean) instead.

RegisterChannel(IChannel, Boolean) RegisterChannel(IChannel, Boolean) RegisterChannel(IChannel, Boolean) RegisterChannel(IChannel, Boolean)

向信道服务注册信道。Registers a channel with the channel services.

SyncDispatchMessage(IMessage) SyncDispatchMessage(IMessage) SyncDispatchMessage(IMessage) SyncDispatchMessage(IMessage)

根据嵌入在消息中的 URI 将传入的消息同步调度到服务器端链。Synchronously dispatches the incoming message to the server-side chain(s) based on the URI embedded in the message.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
UnregisterChannel(IChannel) UnregisterChannel(IChannel) UnregisterChannel(IChannel) UnregisterChannel(IChannel)

从注册信道列表中注销特定的信道。Unregisters a particular channel from the registered channels list.

适用于

另请参阅