PeerContact.PeerEndPoints 속성

정의

PeerEndPointCollection와 연결된 PeerContact를 가져옵니다.

public:
 virtual property System::Net::PeerToPeer::Collaboration::PeerEndPointCollection ^ PeerEndPoints { System::Net::PeerToPeer::Collaboration::PeerEndPointCollection ^ get(); };
public override System.Net.PeerToPeer.Collaboration.PeerEndPointCollection PeerEndPoints { [System.Security.SecurityCritical] get; }
[<get: System.Security.SecurityCritical>]
member this.PeerEndPoints : System.Net.PeerToPeer.Collaboration.PeerEndPointCollection
Public Overrides ReadOnly Property PeerEndPoints As PeerEndPointCollection

속성 값

PeerEndPoint와 연결된 PeerContact 컬렉션입니다. 이 속성의 기본값은 null입니다.

특성

예외

PeerContact 개체가 삭제되었습니다.

예제

다음 코드 예제를 적절 하 게 사용 된 PeerEndPoints 속성:

// If more than one endpoint for a contact exists, let the user choose which to use.
//Parameters:
//   pContact - contact to pick an endpoint for
//   return value: pPeerEndpoint -  the endpoint the user picked
private static PeerEndPoint PickEndpointForContact(PeerContact pContact)
{
    PeerEndPointCollection endPointCollection = pContact.PeerEndPoints;
    if (endPointCollection == null)
    {
        Console.WriteLine("Cannot return endpoint for contact {0} -- PeerEndPointCollection is null.", pContact);
        return null;
    }

    if (endPointCollection.Count == 0)
    {
        Console.WriteLine("Cannot return endpoint for contact {0} -- PeerEndPointCollection is empty.", pContact);
        return null;
    }

    foreach (PeerEndPoint pep in endPointCollection)
    {
        Console.WriteLine("PeerEndPoint is {0}:" , pep);
        Console.WriteLine("PeerEndPoint information:\n Name: {0}\n  IP Address: {1}\n  Port: {2}\n",
            pep.Name,
            pep.EndPoint.Address,
            pep.EndPoint.Port);
    }

    return endPointCollection[0];
}

설명

여부를 PeerEndPoint 원격 피어를 로컬 피어 되었거나이 인스턴스가 나타내는 피어 연락처에 대 한 피어 호스트의 현재 상태에 관련 되지 합니다 PeerEndPoint 는 엔드포인트 PeerEndPointCollection 또는 ContactManager합니다.

적용 대상

추가 정보