IpcClientChannel 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
IPC 프로토콜을 사용하여 메시지를 전송하는 원격 호출에 대한 클라이언트 채널을 구현합니다.
public ref class IpcClientChannel : System::Runtime::Remoting::Channels::IChannelSender, System::Runtime::Remoting::Channels::ISecurableChannel
public class IpcClientChannel : System.Runtime.Remoting.Channels.IChannelSender, System.Runtime.Remoting.Channels.ISecurableChannel
type IpcClientChannel = class
interface IChannelSender
interface IChannel
interface ISecurableChannel
Public Class IpcClientChannel
Implements IChannelSender, ISecurableChannel
- 상속
-
IpcClientChannel
- 구현
예제
다음 코드 예제에서는 클래스를 사용 하는 방법을 보여 있습니다 IpcClientChannel .
#using <System.Runtime.Remoting.dll>
#using <System.dll>
#using <Counter.dll>
using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Ipc;
public ref class Client
{
public:
void ClientTest()
{
IpcClientChannel^ clientChannel = gcnew IpcClientChannel;
ChannelServices::RegisterChannel( clientChannel );
RemotingConfiguration::RegisterWellKnownClientType( Counter::typeid, L"ipc://remote/counter" );
Counter^ counter = gcnew Counter;
Console::WriteLine( L"This is call number {0}.", counter->Count );
}
};
int main()
{
Client^ c = gcnew Client;
c->ClientTest();
}
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;
public class Client
{
public static void Main ()
{
IpcClientChannel clientChannel = new IpcClientChannel();
ChannelServices.RegisterChannel(clientChannel);
RemotingConfiguration.RegisterWellKnownClientType( typeof(Counter) , "ipc://remote/counter" );
Counter counter = new Counter();
Console.WriteLine("This is call number {0}.", counter.Count);
}
}
앞의 코드는 다음 원격 개체를 사용합니다.
using namespace System;
public ref class Counter: public MarshalByRefObject
{
private:
int count;
public:
Counter()
{
count = 0;
}
property int Count
{
int get()
{
return (count)++;
}
}
};
using System;
public class Counter : MarshalByRefObject {
private int count = 0;
public int Count { get {
return(count++);
} }
}
이 개체를 원격으로 노출하는 서버의 예는 다음을 참조하세요 IpcServerChannel.
설명
Important
신뢰할 수 없는 데이터를 사용하여 이 클래스에서 메서드를 호출하는 것은 보안 위험입니다. 신뢰할 수 있는 데이터로만 이 클래스의 메서드를 호출합니다. 자세한 내용은 모든 입력 유효성 검사참조하세요.
채널은 .NET 프레임워크 원격 인프라에서 원격 호출을 전송하는 데 사용됩니다. 클라이언트가 원격 개체를 호출하면 클라이언트 채널에서 보내고 서버 채널에서 수신하는 메시지로 호출이 직렬화됩니다. 메시지가 수신되면 역직렬화되고 처리됩니다. 반환된 값은 서버 채널에서 전송되고 클라이언트 채널에서 수신됩니다.
IpcClientChannel 클래스는 Windows IPC(프로세스 간 통신) 시스템을 사용하여 동일한 컴퓨터의 애플리케이션 도메인 간에 메시지를 전송합니다. 동일한 컴퓨터의 애플리케이션 도메인 간에 통신할 때 IPC 채널은 TCP 또는 HTTP 채널보다 훨씬 빠릅니다.
클라이언트 쪽에서 메시지의 추가 처리를 수행하려면 개체에서 처리된 모든 메시지가 전달되는 인터페이스의 IClientChannelSinkProvider 구현을 IpcClientChannel 지정할 수 있습니다.
기본적으로 클래스는 IpcClientChannel 이진 포맷터를 사용하여 모든 메시지를 직렬화합니다.
IpcClientChannel 개체에는 구성 파일(정적 RemotingConfiguration.Configure 메서드를 호출하여) 또는 프로그래밍 방식으로(생성자에 컬렉션을 전달하여) 런타임에 설정할 수 있는 IDictionary 연결된 구성 속성이 IpcClientChannel 있습니다. 이러한 구성 속성 목록은 생성자에 대한 IpcClientChannel 설명서를 참조하세요.
생성자
| Name | Description |
|---|---|
| IpcClientChannel() |
IpcServerChannel 클래스의 새 인스턴스를 초기화합니다. |
| IpcClientChannel(IDictionary, IClientChannelSinkProvider) |
지정된 구성 속성 및 싱크를 IpcClientChannel 사용하여 클래스의 새 인스턴스를 초기화합니다. |
| IpcClientChannel(String, IClientChannelSinkProvider) |
지정된 이름과 싱크를 사용하여 클래스의 IpcClientChannel 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| ChannelName |
현재 채널의 이름을 가져옵니다. |
| ChannelPriority |
현재 채널의 우선 순위를 가져옵니다. |
| IsSecured |
현재 채널이 안전한지 여부를 나타내는 부울 값을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| CreateMessageSink(String, Object, String) |
지정된 URL 또는 채널 데이터 개체에 메시지를 전달하는 채널 메시지 싱크를 반환합니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| Parse(String, String) |
지정된 URL에서 채널 URI 및 잘 알려진 원격 개체 URI를 추출합니다. |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |