Peer.GetObjects Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the collection of data objects from a local cache.

Namespace:   System.Net.PeerToPeer.Collaboration
Assembly:  System.Net (in System.Net.dll)

public PeerObjectCollection GetObjects()

Return Value

Type: System.Net.PeerToPeer.Collaboration.PeerObjectCollection

The PeerObject collection for the peer or endpoint specified by this instance.

Exception Condition

The caller is not subscribed to the endpoint or has not yet called RefreshData.


The method is unable to complete due to an error in the underlying Peer Collaboration infrastructure.

This functionality is only exposed on the PeerContact class. This functionality is not exposed on any other type of peer for security reasons.

If the peer collaboration session did not instantiate with a PermissionState of Unrestricted, this method cannot access objects on the local computer. The same is true of the applications registered into the collaboration session.

The collection of peer objects consists of application, data object, and presence information for the peer or endpoint specified by this instance. If no objects are found for the endpoint, a collection of size zero (0) is returned. If the calling peer is subscribed to this endpoint, the cache is automatically updated; otherwise RefreshData must be called prior to calling this method.

The caller is not required to be signed into the collaboration infrastructure for this method to complete successfully. A successful call to RefreshData or one of the Subscribe methods must have been completed while the caller was signed in previous to calling this method.

NOTE: Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

.NET Framework
Available since 3.5
Return to top