Questo articolo è stato tradotto automaticamente. Per visualizzare l'articolo in inglese, selezionare la casella di controllo Inglese. È possibile anche visualizzare il testo inglese in una finestra popup posizionando il puntatore del mouse sopra il testo.
Traduzione
Inglese

Metodo PeerNameResolver.ResolveAsync (PeerName, Object)

 

Inizia un'operazione asincrona di risoluzione del nome peer per l'oggetto PeerName specificato in tutte le aree cloud note al peer chiamante.

Spazio dei nomi:   System.Net.PeerToPeer
Assembly:  System.Net (in System.Net.dll)

[HostProtectionAttribute(SecurityAction.LinkDemand, ExternalThreading = true)]
public void ResolveAsync(
	PeerName peerName,
	object userState
)

Parametri

peerName
Type: System.Net.PeerToPeer.PeerName

Oggetto PeerName da risolvere.

userState
Type: System.Object

Oggetto definito dall'utente che contiene le informazioni sullo stato dell'operazione di risoluzione del nome peer.

Exception Condition
ArgumentNullException

Uno o entrambi i parametri peerName e userState sono impostati su null.

This method asynchronously associates a peer name to clouds. All clouds are queried for the T:System.Net.PeerToPeer.PeerName. It raises the E:System.Net.PeerToPeer.PeerNameResolver.ResolveCompleted event, which calls back to the M:System.Net.PeerToPeer.PeerNameResolver.OnResolveCompleted(System.Net.PeerToPeer.ResolveCompletedEventArgs) method. Or, it raises the E:System.Net.PeerToPeer.PeerNameResolver.ResolveProgressChanged event, which calls back to the M:System.Net.PeerToPeer.PeerNameResolver.OnResolveProgressChanged(System.Net.PeerToPeer.ResolveProgressChangedEventArgs) method.

If the peer name cannot be resolved, an T:System.Net.PeerToPeer.PeerToPeerException is thrown.

For unsecured peer names, the same name can be registered (and associated with different endpoints) by different peers within the same cloud.

Calling the T:System.Net.PeerToPeer.PeerNameResolver method is similar to calling the Overload:System.Net.PeerToPeer.PeerNameResolver.ResolveAsync method for each peer name record in the T:System.Net.PeerToPeer.PeerNameRecordCollection. Note that using the Resolve method on an individual peer name record does not invalidate resolving multiple peer names.

For every Overload:System.Net.PeerToPeer.PeerNameResolver.ResolveAsync method, there is an equivalent Overload:System.Net.PeerToPeer.PeerNameResolver.Resolve method. Their parameter lists are identical, except that the ResolveAsync method includes a system token for asynchronous event handling, and the Resolve method is intended for synchronous processing.

All asynchronous references to the resolver object are coordinated with a unique identifier token. This userState token or message identifier allows an operating system to deliver a message to a single receiving process after the message has been placed on the message queue.

The E:System.Net.PeerToPeer.PeerNameResolver.ResolveCompleted event will be raised if the resolve operation completes in error or is canceled.

.NET Framework
Disponibile da 3.5
Torna all'inizio
Mostra: