共用方式為


WiFiDirectServiceSession.RemotePortAdded 事件

定義

將新的遠端埠新增至會話時引發的事件。 事件處理常式應該藉由建立與新遠端埠的適當通訊端連線來回應。

// 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) 

事件類型

適用於