Last active
July 7, 2022 06:03
-
-
Save m-hayabusa/0e3f46f0afd7e96cd60296ed2e5cea4b to your computer and use it in GitHub Desktop.
OSCのメッセージをちぎって投げる
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
$endPoint = New-Object System.Net.IPEndPoint([IPAddress]::Loopback, 9001) | |
$udpListener = New-Object System.Net.Sockets.UdpClient($endPoint) | |
$udpClient = New-Object System.Net.Sockets.UdpClient | |
$udpClient.Connect("127.0.0.1", 9011) | |
while ($true) { | |
$data = $udpListener.Receive([ref]$endPoint) | |
[System.Text.Encoding]::ASCII.GetString($data) | Write-Host | |
[Void]$udpClient.Send($data, $data.Length) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment