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).

예외

asyncResultnull입니다.

asyncResult가 호출에 BeginWrite(Byte[], Int32, Int32, AsyncCallback, Object)의해 만들어지지 않았습니다.

완료할 보류 중인 쓰기 작업이 없습니다.

-또는-

인증이 발생하지 않았습니다.

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

예제

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

' 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

설명

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

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

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

적용 대상