async void OnSetString(object sender, RoutedEventArgs e) { if (await AtTestRpc.SetString("abc")) { _tbInfo.Text = "OnSetString成功"; } }
async void OnServerStream(object sender, RoutedEventArgs e) { _tbInfo.Text = "ServerStream模式:"; var _reader = await AtTestRpc.OnServerStream("hello"); while (await _reader.MoveNext()) { _tbInfo.Text += $"{Environment.NewLine}收到:{_reader.Val<string>()}"; } _tbInfo.Text += Environment.NewLine + "结束"; }
async void OnGetString(object sender, RoutedEventArgs e) { _tbInfo.Text = "返回:" + await AtTestRpc.GetString(); }