This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env pwsh | |
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process | |
function Start-Command ([String]$Path, [String]$Arguments) { | |
$pinfo = New-Object System.Diagnostics.ProcessStartInfo | |
$pinfo.FileName = $Path | |
$pinfo.RedirectStandardError = $true | |
$pinfo.RedirectStandardOutput = $true | |
$pinfo.UseShellExecute = $false | |
$pinfo.Arguments = $Arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 感谢强大的 reactphp 。 | |
* 使用 reactphp 创建的可以限制连接数量的消息服务器 | |
* 1. 可以群发消息 | |
* 2. 可以客户端单对单发消息 | |
* 3. 可以服务器对单个客户端发送消息 | |
* usage by `composer require react/socket:^1.1` | |
**/ | |
require_once __DIR__ . '/vendor/autoload.php'; |