DuplexClientBase<TChannel> 클래스

정의

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

generic <typename TChannel>
 where TChannel : classpublic ref class DuplexClientBase abstract : System::ServiceModel::ClientBase<TChannel>
public abstract class DuplexClientBase<TChannel> : System.ServiceModel.ClientBase<TChannel> where TChannel : class
type DuplexClientBase<'Channel (requires 'Channel : null)> = class
    inherit ClientBase<'Channel (requires 'Channel : null)>
Public MustInherit Class DuplexClientBase(Of TChannel)
Inherits ClientBase(Of TChannel)

형식 매개 변수

TChannel

만들 채널의 형식입니다.

상속
DuplexClientBase<TChannel>

예제

다음 예제에서는 이중 WCF 클라이언트 형식 SampleDuplexHelloClient의 클라이언트에서 를 사용하여 콜백을 수신 대기할 콜백 개체와 함께 새 System.ServiceModel.InstanceContext 개체를 전달하는 방법을 보여 줍니다.

using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Threading;

namespace Microsoft.WCF.Documentation
{
  [CallbackBehaviorAttribute(
   IncludeExceptionDetailInFaults= true,
    UseSynchronizationContext=true,
    ValidateMustUnderstand=true
  )]
  public class Client : SampleDuplexHelloCallback
  {
    AutoResetEvent waitHandle;

    public Client()
    {
      waitHandle = new AutoResetEvent(false);
    }

    public void Run()
    {
      // Picks up configuration from the configuration file.
      SampleDuplexHelloClient wcfClient
        = new SampleDuplexHelloClient(new InstanceContext(this), "WSDualHttpBinding_SampleDuplexHello");
      try
      {
        Console.ForegroundColor = ConsoleColor.White;
        Console.WriteLine("Enter a greeting to send and press ENTER: ");
        Console.Write(">>> ");
        Console.ForegroundColor = ConsoleColor.Green;
        string greeting = Console.ReadLine();
        Console.ForegroundColor = ConsoleColor.White;
        Console.WriteLine("Called service with: \r\n\t" + greeting);
        wcfClient.Hello(greeting);
        Console.WriteLine("Execution passes service call and moves to the WaitHandle.");
        this.waitHandle.WaitOne();
        Console.ForegroundColor = ConsoleColor.Blue;
        Console.WriteLine("Set was called.");
        Console.Write("Press ");
        Console.ForegroundColor = ConsoleColor.Red;
        Console.Write("ENTER");
        Console.ForegroundColor = ConsoleColor.Blue;
        Console.Write(" to exit...");
        Console.ReadLine();
      }
      catch (TimeoutException timeProblem)
      {
        Console.WriteLine("The service operation timed out. " + timeProblem.Message);
        Console.ReadLine();
      }
      catch (CommunicationException commProblem)
      {
        Console.WriteLine("There was a communication problem. " + commProblem.Message);
        Console.ReadLine();
      }
    }
    public static void Main()
    {
      Client client = new Client();
      client.Run();
    }

    public void Reply(string response)
    {
      Console.WriteLine("Received output.");
      Console.WriteLine("\r\n\t" + response);
      this.waitHandle.Set();
    }
  }
}

Imports System.ServiceModel
Imports System.ServiceModel.Channels
Imports System.Threading

Namespace Microsoft.WCF.Documentation
  <CallbackBehaviorAttribute(IncludeExceptionDetailInFaults:= True, UseSynchronizationContext:=True, ValidateMustUnderstand:=True)> _
  Public Class Client
      Implements SampleDuplexHelloCallback
    Private waitHandle As AutoResetEvent

    Public Sub New()
      waitHandle = New AutoResetEvent(False)
    End Sub

    Public Sub Run()
      ' Picks up configuration from the configuration file.
      Dim wcfClient As New SampleDuplexHelloClient(New InstanceContext(Me), "WSDualHttpBinding_SampleDuplexHello")
      Try
        Console.ForegroundColor = ConsoleColor.White
        Console.WriteLine("Enter a greeting to send and press ENTER: ")
        Console.Write(">>> ")
        Console.ForegroundColor = ConsoleColor.Green
        Dim greeting As String = Console.ReadLine()
        Console.ForegroundColor = ConsoleColor.White
        Console.WriteLine("Called service with: " & Constants.vbCrLf & Constants.vbTab & greeting)
        wcfClient.Hello(greeting)
        Console.WriteLine("Execution passes service call and moves to the WaitHandle.")
        Me.waitHandle.WaitOne()
        Console.ForegroundColor = ConsoleColor.Blue
        Console.WriteLine("Set was called.")
        Console.Write("Press ")
        Console.ForegroundColor = ConsoleColor.Red
        Console.Write("ENTER")
        Console.ForegroundColor = ConsoleColor.Blue
        Console.Write(" to exit...")
        Console.ReadLine()
      Catch timeProblem As TimeoutException
        Console.WriteLine("The service operation timed out. " & timeProblem.Message)
        Console.ReadLine()
      Catch commProblem As CommunicationException
        Console.WriteLine("There was a communication problem. " & commProblem.Message)
        Console.ReadLine()
      End Try
    End Sub
    Public Shared Sub Main()
      Dim client As New Client()
      client.Run()
    End Sub

    Public Sub Reply(ByVal response As String) Implements SampleDuplexHelloCallback.Reply
      Console.WriteLine("Received output.")
      Console.WriteLine(Constants.vbCrLf & Constants.vbTab & response)
      Me.waitHandle.Set()
    End Sub
  End Class
End Namespace

설명

클래스를 DuplexClientBase<TChannel> 사용하여 콜백 개체를 지정하는 서비스에 대한 채널을 만듭니다. 개체는 DuplexClientBase<TChannel> WCF 개체에 대한 연결을 제공하는 개체를 래핑 System.ServiceModel.DuplexChannelFactory<TChannel> 합니다. 두 형식 중 하나를 사용하여 이중 서비스에 연결할 수 있습니다. 이중 서비스에 대한 자세한 내용은 이중 서비스를 참조하세요.

이 클래스에서 파생된 Managed C++ 사용자 관련 참고 사항:

  • 소멸자가 아니라 (On)(Begin)Close 및/또는 OnAbort에 정리 코드를 입력하십시오.

  • 소멸자 방지: 컴파일러가 자동으로 생성되도록 합니다. IDisposable

  • 참조가 아닌 멤버 방지: 컴파일러가 자동으로 생성될 수 있습니다. IDisposable

  • 종료자 방지; 를 포함하는 경우 자동 생성된 IDisposable 동작을 에뮬레이트하기 위해 빌드 경고 및 호출 SuppressFinalize(Object) 및 종료자 자체를 (켜기)(시작)닫기(및/또는 OnAbort)에서 표시하지 않아야 합니다.

생성자

DuplexClientBase<TChannel>(InstanceContext)

지정된 콜백 개체를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(InstanceContext, Binding, EndpointAddress)

지정된 콜백 개체, 바인딩 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(InstanceContext, ServiceEndpoint)

지정된 콜백 개체 및 서비스 엔드포인트를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(InstanceContext, String)

지정된 콜백 개체 및 구성 이름을 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(InstanceContext, String, EndpointAddress)

지정된 콜백 개체, 구성 이름 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(InstanceContext, String, String)

지정된 콜백 개체, 구성 이름 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object)

지정된 콜백 개체를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object, Binding, EndpointAddress)

지정된 콜백 개체, 바인딩 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object, ServiceEndpoint)

지정된 콜백 개체 및 서비스 엔드포인트를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object, String)

지정된 콜백 개체 및 구성 이름을 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object, String, EndpointAddress)

지정된 콜백 개체, 구성 이름 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

DuplexClientBase<TChannel>(Object, String, String)

지정된 콜백 개체, 엔드포인트 구성 이름 및 서비스 엔드포인트 주소를 사용하여 DuplexClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

속성

Channel

다양하게 구성된 서비스 엔드포인트로 메시지를 보내는 데 사용되는 내부 채널을 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)
ChannelFactory

내부 ChannelFactory<TChannel> 개체를 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)
ClientCredentials

작업 호출에 사용되는 클라이언트 자격 증명을 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)
Endpoint

WCF 클라이언트가 연결할 수 있는 서비스의 대상 엔드포인트를 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)
InnerChannel

내부 IClientChannel 구현을 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)
InnerDuplexChannel

이중 채널의 기본 IClientChannel 구현을 가져옵니다.

State

ClientBase<TChannel> 개체의 현재 상태를 가져옵니다.

(다음에서 상속됨 ClientBase<TChannel>)

메서드

Abort()

ClientBase<TChannel> 개체가 즉시 현재 상태에서 Closed 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
Close()

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
CloseAsync()

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

(다음에서 상속됨 ClientBase<TChannel>)
CreateChannel()

생성자에 전달된 콜백 개체와 연결된 서비스에 대한 채널을 반환합니다.

CreateChannel()

서비스에 대한 새 채널을 반환합니다.

(다음에서 상속됨 ClientBase<TChannel>)
DisplayInitializationUI()

채널을 초기화하는 데 사용자 인터페이스가 필요한 경우 채널을 사용하기 전에 내부 채널이 사용자 인터페이스를 표시하도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
Equals(Object)

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

(다음에서 상속됨 Object)
GetDefaultValueForInitialization<T>()

C#에서 기본 키워드의 동작을 복제합니다.

(다음에서 상속됨 ClientBase<TChannel>)
GetHashCode()

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

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

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

(다음에서 상속됨 Object)
InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object)

이벤트 기반 비동기 패턴을 구현하도록 지원합니다. 이 패턴에 대한 자세한 내용은 이벤트 기반 비동기 패턴 개요를 참조하세요.

(다음에서 상속됨 ClientBase<TChannel>)
MemberwiseClone()

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

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

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
OpenAsync()

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

(다음에서 상속됨 ClientBase<TChannel>)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IAsyncDisposable.DisposeAsync()

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.BeginClose(AsyncCallback, Object)

ClientBase<TChannel>를 닫기 위한 비동기 작업을 시작합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object)

지정된 시간 제한 내에 ClientBase<TChannel>를 닫기 위한 비동기 작업을 시작합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.BeginOpen(AsyncCallback, Object)

ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 시작합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object)

지정된 시간 간격 내에 ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 시작합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Close()

통신 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Close(TimeSpan)

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Closed

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되었을 때 호출되는 이벤트 처리기입니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Closing

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환될 때 호출되는 이벤트 처리기입니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.EndClose(IAsyncResult)

ClientBase<TChannel> 개체를 닫기 위한 비동기 작업을 완료합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.EndOpen(IAsyncResult)

ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 완료합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Faulted

ClientBase<TChannel> 개체에 대해 작업을 수행하는 도중 오류가 발생하면 호출되는 이벤트 처리기입니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Open()

통신 개체가 Created 상태에서 Opened 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Open(TimeSpan)

ClientBase<TChannel> 개체가 지정된 시간 간격 내에 Created 상태에서 Opened 상태로 전환되도록 합니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Opened

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환될 때 호출되는 이벤트 처리기입니다.

(다음에서 상속됨 ClientBase<TChannel>)
ICommunicationObject.Opening

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환될 때 호출되는 이벤트 처리기입니다.

(다음에서 상속됨 ClientBase<TChannel>)
IDisposable.Dispose()

Dispose() 메서드의 명시적 구현입니다.

(다음에서 상속됨 ClientBase<TChannel>)

확장 메서드

CloseHelperAsync(ICommunicationObject, TimeSpan)

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

OpenHelperAsync(ICommunicationObject, TimeSpan)

이중 서비스에 대한 채널을 만들고 해당 채널을 콜백 개체와 연결하는 데 사용됩니다.

ConfigureAwait(IAsyncDisposable, Boolean)

비동기 일회용에서 반환되는 작업을 대기하는 방법을 구성합니다.

적용 대상