는 단순히문을 사용할 때 비동기 wcf 메서드를 호출하는 방법? 동기식 모델에서
using (MyServiceClient msc = new MyServiceClient())
{
msc.Method();
}
이다하지만이 방법의 끝에 기다린 후 무언가를해야하는 경우, 그것은 using
에서 비동기 mehod를 호출하는 방법 또한
private void EventHandler<MethodCompletedEventArgs> myEventHandler = new EventHandler<MethodCompletedEventArgs>(methodBody);
using (MyServiceClient msc = new MyServiceClient())
{
msc.MethdCompleted += myEventHandler;
msc.BeginMethod();
}
private void MethodBody()
{
//exception: client state is aborted
}
작동하지 않을 수 있습니다 성명서?
서비스를 호출하는 응용 프로그램 유형은 무엇입니까? –
이벤트 핸들러에서 Dispose 호출 –