UdpClient.Close 메서드

정의

UDP 연결을 닫습니다.

public:
 void Close();
public void Close ();
member this.Close : unit -> unit
Public Sub Close ()

예외

소켓에 액세스할 때 오류가 발생했습니다.

예제

다음 예제에서는 메서드를 호출하여 를 UdpClient 닫는 방법을 Close 보여 줍니다.

// Closes the UDP client by calling the public method Close().
udpClient->Close();
// Closes the UDP client by calling the public method Close().
udpClient.Close();
' Closes the UDP client by calling the public method Close().
udpClient.Close()

설명

Close 기본 Socket 을 사용하지 않도록 설정하고 와 연결된 모든 관리 및 관리되지 않는 리소스를 UdpClient해제합니다.

참고

를 수신하는 SocketException경우 를 사용하여 SocketException.ErrorCode 특정 오류 코드를 가져옵니다. 이 코드를 가져온 후에는 Windows 소켓 버전 2 API 오류 코드 설명서를 참조하여 오류에 대한 자세한 설명을 확인할 수 있습니다.

적용 대상

추가 정보