NegotiateStream.EndWrite(IAsyncResult) 메서드

정의

BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)를 호출하여 시작한 비동기 쓰기 작업을 끝냅니다.

public:
 override void EndWrite(IAsyncResult ^ asyncResult);
public override void EndWrite (IAsyncResult asyncResult);
override this.EndWrite : IAsyncResult -> unit
Public Overrides Sub EndWrite (asyncResult As IAsyncResult)

매개 변수

asyncResult
IAsyncResult

IAsyncResult를 호출했을 때 반환되는 BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object) 인스턴스입니다.

예외

asyncResult이(가) null인 경우

BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)를 호출했지만 asyncResult가 만들어지지 않은 경우

완료할 보류 상태의 쓰기 작업이 없는 경우.

또는

인증이 수행되지 않은 경우.

쓰기 작업이 실패했습니다.

예제

다음 예제에서는 비동기 쓰기 작업을 완료하기 위해 호출되는 메서드를 보여 줍니다. 작업을 시작하는 방법을 보여 주는 예제는 를 참조하세요 BeginWrite.

// The following method is called when the write operation completes.
static void EndWriteCallback( IAsyncResult^ ar )
{
   Console::WriteLine( L"Client ending write operation..." );
   NegotiateStream^ authStream = dynamic_cast<NegotiateStream^>(ar->AsyncState);
   
   // End the asynchronous operation.
   authStream->EndWrite( ar );
}

' The following method is called when the write operation completes.
Public Shared Sub EndWriteCallback(ar As IAsyncResult)

    Console.WriteLine("Client ending write operation...")
    Dim authStream = CType(ar.AsyncState, NegotiateStream)

    ' End the asynchronous operation.
    authStream.EndWrite(ar)

End Sub

설명

작업이 완료되지 않은 경우 이 메서드는 작업이 완료될 때까지 차단합니다.

성공적으로 인증될 때까지 이 메서드를 호출할 수 없습니다. 인증하려면 , , , AuthenticateAsClientAsyncBeginAuthenticateAsClient, AuthenticateAsServerAuthenticateAsServerAsync또는 BeginAuthenticateAsServer 메서드 중 AuthenticateAsClient하나를 호출합니다.

이 작업을 동기적으로 수행하려면 메서드를 Write 사용합니다.

적용 대상