AppServiceConnection AppServiceConnection AppServiceConnection AppServiceConnection Class

Definition

Represents a connection to the endpoint for an app service. App services enable app-to-app communication by allowing you to provide services from your Universal Windows app to other Universal Windows app.

public : sealed class AppServiceConnection : IAppServiceConnection, IAppServiceConnection2, IClosablepublic sealed class AppServiceConnection : IAppServiceConnection, IAppServiceConnection2, IDisposablePublic NotInheritable Class AppServiceConnection Implements IAppServiceConnection, IAppServiceConnection2, IDisposable// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

AppServiceConnection() AppServiceConnection() AppServiceConnection() AppServiceConnection()

Creates and initializes a new instance of the AppServiceConnection class.

public : AppServiceConnection()public AppServiceConnection()Public Sub New()// You can use this method in JavaScript.

Properties

AppServiceName AppServiceName AppServiceName AppServiceName

Gets or sets the name of the app service to which you want to connect.

public : PlatForm::String AppServiceName { get; set; }public string AppServiceName { get; set; }Public ReadWrite Property AppServiceName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the app service to which you want to connect.

PackageFamilyName PackageFamilyName PackageFamilyName PackageFamilyName

Gets or sets the package family name for the package that contains the endpoint for the app service.

public : PlatForm::String PackageFamilyName { get; set; }public string PackageFamilyName { get; set; }Public ReadWrite Property PackageFamilyName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The package family name for the package that contains the endpoint for the app service.

User User User User

Gets/sets the user context. This property returns null if the caller did not specify a user.

public : User User { get; set; }public User User { get; set; }Public ReadWrite Property User As User// You can use this property in JavaScript.
Value
User User User User

The user of the app service.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property is set by the caller. Callers that have the multi-user manifest entry must set this property even if the app is not running on a multi-user platform.

Methods

Close() Close() Close() Close()

Closes the connection to the app service.

public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.

Remarks

You cannot call Close methods through Visual C++ component extensions (C++/CX) on Windows Runtime class instances where the class implemented IClosable. Instead, Visual C++ component extensions (C++/CX) code for runtime classes should call the destructor or set the last reference to null.

Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()

OpenAsync() OpenAsync() OpenAsync() OpenAsync()

Opens a connection to the endpoint for the app service.

public : IAsyncOperation<AppServiceConnectionStatus> OpenAsync()public IAsyncOperation<AppServiceConnectionStatus> OpenAsync()Public Function OpenAsync() As IAsyncOperation( Of AppServiceConnectionStatus )// You can use this method in JavaScript.
Returns

OpenRemoteAsync(RemoteSystemConnectionRequest) OpenRemoteAsync(RemoteSystemConnectionRequest) OpenRemoteAsync(RemoteSystemConnectionRequest) OpenRemoteAsync(RemoteSystemConnectionRequest)

Opens a connection to the endpoint on another device for the app service.

public : IAsyncOperation<AppServiceConnectionStatus> OpenRemoteAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest)public IAsyncOperation<AppServiceConnectionStatus> OpenRemoteAsync(RemoteSystemConnectionRequest remoteSystemConnectionRequest)Public Function OpenRemoteAsync(remoteSystemConnectionRequest As RemoteSystemConnectionRequest) As IAsyncOperation( Of AppServiceConnectionStatus )// You can use this method in JavaScript.
Parameters
remoteSystemConnectionRequest
RemoteSystemConnectionRequest RemoteSystemConnectionRequest RemoteSystemConnectionRequest RemoteSystemConnectionRequest

Specifies the connection preferences for the AppServiceConnection, such as transport preferences (cloud/proximal/any) as well as the target System.RemoteSystems object.

Returns
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)
Capabilities
remoteSystem

SendMessageAsync(ValueSet) SendMessageAsync(ValueSet) SendMessageAsync(ValueSet) SendMessageAsync(ValueSet)

Sends a message to the other endpoint of the app service connection.

public : IAsyncOperation<AppServiceResponse> SendMessageAsync(ValueSet message)public IAsyncOperation<AppServiceResponse> SendMessageAsync(ValueSet message)Public Function SendMessageAsync(message As ValueSet) As IAsyncOperation( Of AppServiceResponse )// You can use this method in JavaScript.
Parameters
message
ValueSet ValueSet ValueSet ValueSet

The message that you want to send.

Returns

An asynchronous operation to send the message that optionally returns a response message when complete.

See Also

Events

RequestReceived RequestReceived RequestReceived RequestReceived

Occurs when a message arrives from the other endpoint of the app service connection.

public : event TypedEventHandler RequestReceived<AppServiceConnection,  AppServiceRequestReceivedEventArgs>public event TypedEventHandler RequestReceived<AppServiceConnection,  AppServiceRequestReceivedEventArgs>Public Event RequestReceived<AppServiceConnection,  AppServiceRequestReceivedEventArgs>// You can use this event in JavaScript.

ServiceClosed ServiceClosed ServiceClosed ServiceClosed

Occurs when the other endpoint closes the connection to the app service.

public : event TypedEventHandler ServiceClosed<AppServiceConnection,  AppServiceClosedEventArgs>public event TypedEventHandler ServiceClosed<AppServiceConnection,  AppServiceClosedEventArgs>Public Event ServiceClosed<AppServiceConnection,  AppServiceClosedEventArgs>// You can use this event in JavaScript.

See Also