dart 命名管道 通信 windows示例

Dart 中的命名管道可以在不同进程之间进行通信。在 Windows 中,可以使用 dart:io 库中的 NamedPipeServer 和 NamedPipeClient 类来实现。

示例代码:

服务端:

import'dart:io';

Future<void> main() async {
  final server = await NamedPipeServer.bind('pipe_name');
  await for (final client in server) {
    client.write("Hello, client!");
    await client.flush();
    client.close();
  }
}

客户端:

import 'dart:io';

Future<void> main() async {
  final client = await NamedPipeClient.connect('pipe_name');
  final response = await client.first;
  print(response);
  client.close();
}

在上面的示例中,服务端会等待客户端连接,一旦连接上,服务端会向客户端发送 "Hello, client!" 的消息,客户端会接收到这条消息并打印出来。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DaRT 版本信息 DaRT 10 - Windows 10 DaRT 8.1 - Windows 8.1, Windows Server 2012 R2 DaRT 8.0 - Windows 8, Windows Server 2012 DaRT 7.0 - Windows 7, Windows Server 2008 R2 DaRT 6.5 - Windows 7, Windows Server 2008 R2 DaRT 6.0 - Windows Vista, Windows Server 2008 DaRT 5.0 - Windows 2000, Windows XP, Windows Server 2003 Microsoft Diagnostics and Recovery Toolset (DaRT) 8.1 provides the following enhancements, which are described in this topic. What’s new Support for WIMBoot Diagnostics and Recovery Toolset 8.1 supports the Windows image file boot (WIMBoot) environment if these conditions are met: WIMBoot is based on Windows 8.1 Update 1 or later. The DaRT 8.1 image is built on Windows 8.1 Update 1 or later. For more information about WIMBoot, see Windows Image File Boot (WIMBoot) Overview. Support for Windows Server 2012 R2 and Windows 8.1 You can create DaRT images by using Windows Server 2012 R2 or Windows 8.1. Note For earlier versions of the Windows Server and Windows operating systems, continue to use the earlier versions of DaRT. Customer feedback DaRT 8.1 includes updates that address issues found since the DaRT 8.0 SP1 release. Windows Defender Windows Defender in Windows 8.1 includes improved protection. The changes do not impact how you use DaRT with Windows Defender. Requirements Windows Assessment and Development Kit 8.1 Windows Assessment and Development Kit (ADK) 8.1 is a required prerequisite for the DaRT Recovery Image Wizard. Windows ADK 8.1 contains deployment tools that are used to customize, deploy, and service Windows images. It also contains the Windows Preinstallation Environment (Windows PE). Note Windows ADK 8.1 is not required if you are installing only Remote Connection Viewer or Crash Analyzer.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值