WellKnownClientTypeEntry 클래스

정의

서버 활성 형식(SingleCall 또는 Singleton)으로 클라이언트에 등록된 개체 형식에 대한 값이 들어 있습니다.

public ref class WellKnownClientTypeEntry : System::Runtime::Remoting::TypeEntry
public class WellKnownClientTypeEntry : System.Runtime.Remoting.TypeEntry
[System.Runtime.InteropServices.ComVisible(true)]
public class WellKnownClientTypeEntry : System.Runtime.Remoting.TypeEntry
type WellKnownClientTypeEntry = class
    inherit TypeEntry
[<System.Runtime.InteropServices.ComVisible(true)>]
type WellKnownClientTypeEntry = class
    inherit TypeEntry
Public Class WellKnownClientTypeEntry
Inherits TypeEntry
상속
WellKnownClientTypeEntry
특성

예제

#using <System.Runtime.Remoting.dll>
#using <System.dll>
#using <WellKnownClientTypeEntry_Share.dll>

using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Http;

int main()
{
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices::RegisterChannel( gcnew HttpChannel );
   Console::WriteLine( " Start calling from Client One......." );
   WellKnownClientTypeEntry^ myWellKnownClientTypeEntry = gcnew WellKnownClientTypeEntry( HelloServer::typeid,"http://localhost:8086/SayHello" );
   myWellKnownClientTypeEntry->ApplicationUrl = "http://localhost:8086/SayHello";
   RemotingConfiguration::RegisterWellKnownClientType( myWellKnownClientTypeEntry );

   // Get the proxy object for the remote object.
   HelloServer^ myHelloServerObject = gcnew HelloServer;

   // Retrieve an array of object types registered on the 
   // client end as well-known types.
   array<WellKnownClientTypeEntry^>^myWellKnownClientTypeEntryCollection = RemotingConfiguration::GetRegisteredWellKnownClientTypes();
   Console::WriteLine( "The Application Url to activate the Remote Object :{0}", myWellKnownClientTypeEntryCollection[ 0 ]->ApplicationUrl );
   Console::WriteLine( "The 'WellKnownClientTypeEntry' object :{0}", myWellKnownClientTypeEntryCollection[ 0 ] );

   // Make remote method calls.
   for ( int i = 0; i < 5; i++ )
      Console::WriteLine( myHelloServerObject->HelloMethod( " Client One" ) );
}
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

public class MyClient 
{
   public static void Main()
   {
   // Create a 'HttpChannel' object and  register with channel services.
   ChannelServices.RegisterChannel(new HttpChannel());
   Console.WriteLine(" Start calling from Client One.......");
   WellKnownClientTypeEntry myWellKnownClientTypeEntry = 
                  new WellKnownClientTypeEntry(typeof(HelloServer),
                                  "http://localhost:8086/SayHello");
   myWellKnownClientTypeEntry.ApplicationUrl="http://localhost:8086/SayHello";
   RemotingConfiguration.RegisterWellKnownClientType(myWellKnownClientTypeEntry);
   // Get the proxy object for the remote object.
   HelloServer myHelloServerObject = new HelloServer();
   // Retrieve an array of object types registered on the 
   // client end as well-known types.
   WellKnownClientTypeEntry [] myWellKnownClientTypeEntryCollection = 
          RemotingConfiguration.GetRegisteredWellKnownClientTypes();
   Console.WriteLine("The Application Url to activate the Remote Object :"
        +myWellKnownClientTypeEntryCollection[0].ApplicationUrl);
   Console.WriteLine("The 'WellKnownClientTypeEntry' object :"
            +myWellKnownClientTypeEntryCollection[0].ToString());
   // Make remote method calls.
   for (int i = 0; i < 5; i++)
         Console.WriteLine(myHelloServerObject.HelloMethod(" Client One"));
   }
}
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Http

Public Class MyClient
   
   Public Shared Sub Main()
      ' Create a 'HttpChannel' object and  register with channel services.
      ChannelServices.RegisterChannel(New HttpChannel())
      Console.WriteLine(" Start calling from Client One.......")
      Dim myWellKnownClientTypeEntry As New WellKnownClientTypeEntry(GetType(HelloServer), _ 
                                                  "http://localhost:8086/SayHello")
      myWellKnownClientTypeEntry.ApplicationUrl = "http://localhost:8086/SayHello"
      RemotingConfiguration.RegisterWellKnownClientType(myWellKnownClientTypeEntry)
      ' Get the proxy object for the remote object.
      Dim myHelloServerObject As New HelloServer()
      ' Retrieve an array of object types registered on the 
      ' client end as well-known types.
      Dim myWellKnownClientTypeEntryCollection As WellKnownClientTypeEntry() = _ 
                                       RemotingConfiguration.GetRegisteredWellKnownClientTypes()
      Console.WriteLine("The Application Url to activate the Remote Object :" + _ 
                                           myWellKnownClientTypeEntryCollection(0).ApplicationUrl)
      Console.WriteLine("The 'WellKnownClientTypeEntry' object :" + _ 
                                              myWellKnownClientTypeEntryCollection(0).ToString())
      ' Make remote method calls.
      Dim i As Integer
      For i = 0 To 4
         Console.WriteLine(myHelloServerObject.HelloMethod(" Client One"))
      Next i
   End Sub
End Class

설명

서버가 활성화 한 형식 singlecall 또는 singleton 수 있습니다. 클래스는 단일 호출 형식으로 등록 되 면 새 인스턴스를 클라이언트에서 호출이 도착할 때마다 생성 됩니다. 단일 개체에 대 한 모든 호출에 해당 개체는 수집 하지 않는 한 해당 개체의 인스턴스 하나에서 처리 됩니다.

등록된 된 서버 활성 개체의 URI를 알고 있는 클라이언트 채널 사용 하 여 등록 하 여이 개체에 대 한 프록시를 가져올 수 있습니다 ChannelServices 개체를 호출 하 여 활성화 new 또는 Activator.GetObject합니다. 사용 하 여 서버 활성 개체를 활성화 하 new에서 서버 활성 개체 형식을 사용 하는 클라이언트에 먼저 등록 해야 합니다는 RegisterWellKnownClientType 메서드. 호출 하 여 RegisterWellKnownClientType, 부여할 원격 인프라 허용 하는 원격 개체의 위치는 new 키워드를 만듭니다. 반면에 사용 하는 경우는 Activator.GetObject 서버 활성 개체를 활성화 하는 메서드 개체의 URL을 인수로 제공 해야 하므로 클라이언트에서 이전 등록 필요 합니다.

서버 활성화 개체 및 원격 개체 활성화에 대한 자세한 설명은 원격 개체 활성화를 참조하세요.

생성자

WellKnownClientTypeEntry(String, String, String)

지정된 형식, 어셈블리 이름 및 URL을 사용하여 WellKnownClientTypeEntry 클래스의 새 인스턴스를 초기화합니다.

WellKnownClientTypeEntry(Type, String)

지정된 형식 및 URL을 사용하여 WellKnownClientTypeEntry 클래스의 새 인스턴스를 초기화합니다.

속성

ApplicationUrl

형식을 활성화할 애플리케이션의 URL을 가져오거나 설정합니다.

AssemblyName

원격 활성 형식으로 구성된 개체 형식의 어셈블리 이름을 가져옵니다.

(다음에서 상속됨 TypeEntry)
ObjectType

서버 활성 클라이언트 형식의 Type을 가져옵니다.

ObjectUrl

서버 활성 클라이언트 개체의 URL을 가져옵니다.

TypeName

원격 활성 형식으로 구성된 개체 형식의 전체 형식 이름을 가져옵니다.

(다음에서 상속됨 TypeEntry)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

서버 활성 클라이언트 형식의 전체 형식 이름, 어셈블리 이름 및 개체 URL을 String으로 반환합니다.

적용 대상

추가 정보