Partager via


WiFiDirectServiceSession.RemotePortAdded Événement

Définition

Événement déclenché lorsqu’un nouveau port distant est ajouté à la session. Votre gestionnaire d’événements doit répondre en établissant la connexion de socket appropriée au nouveau port distant.

// Register
event_token RemotePortAdded(TypedEventHandler<WiFiDirectServiceSession, WiFiDirectServiceRemotePortAddedEventArgs const&> const& handler) const;

// Revoke with event_token
void RemotePortAdded(event_token const* cookie) const;

// Revoke with event_revoker
WiFiDirectServiceSession::RemotePortAdded_revoker RemotePortAdded(auto_revoke_t, TypedEventHandler<WiFiDirectServiceSession, WiFiDirectServiceRemotePortAddedEventArgs const&> const& handler) const;
public event TypedEventHandler<WiFiDirectServiceSession,WiFiDirectServiceRemotePortAddedEventArgs> RemotePortAdded;
function onRemotePortAdded(eventArgs) { /* Your code */ }
wiFiDirectServiceSession.addEventListener("remoteportadded", onRemotePortAdded);
wiFiDirectServiceSession.removeEventListener("remoteportadded", onRemotePortAdded);
- or -
wiFiDirectServiceSession.onremoteportadded = onRemotePortAdded;
Public Custom Event RemotePortAdded As TypedEventHandler(Of WiFiDirectServiceSession, WiFiDirectServiceRemotePortAddedEventArgs) 

Type d'événement

S’applique à