AppServiceConnection.SendStatelessMessageAsync 方法

定义

打开应用服务连接,发送单个消息,等待单个响应,然后关闭连接。

public:
 static IAsyncOperation<StatelessAppServiceResponse ^> ^ SendStatelessMessageAsync(AppServiceConnection ^ connection, RemoteSystemConnectionRequest ^ connectionRequest, ValueSet ^ message);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<StatelessAppServiceResponse> SendStatelessMessageAsync(AppServiceConnection const& connection, RemoteSystemConnectionRequest const& connectionRequest, ValueSet const& message);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<StatelessAppServiceResponse> SendStatelessMessageAsync(AppServiceConnection connection, RemoteSystemConnectionRequest connectionRequest, ValueSet message);
function sendStatelessMessageAsync(connection, connectionRequest, message)
Public Shared Function SendStatelessMessageAsync (connection As AppServiceConnection, connectionRequest As RemoteSystemConnectionRequest, message As ValueSet) As IAsyncOperation(Of StatelessAppServiceResponse)

参数

connection
AppServiceConnection

要连接到的应用服务。

connectionRequest
RemoteSystemConnectionRequest

指定 AppServiceConnection 的连接首选项,例如传输首选项 (cloud/proximal/any) 以及目标 System.RemoteSystems 对象。

message
ValueSet

要发送的消息。

返回

一个异步操作,用于发送消息,该消息在完成后会返回响应消息。

属性

Windows 要求

设备系列
Windows 10, version 1903 (在 10.0.18362.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v8.0 中引入)

注解

此 API 可以优化不需要通过多个 SendMessageAsync 操作构建状态的远程应用服务方案的延迟。

适用于