Skip to content

Instantly share code, notes, and snippets.

@m-hayabusa
Last active July 7, 2022 06:03
Show Gist options
  • Save m-hayabusa/0e3f46f0afd7e96cd60296ed2e5cea4b to your computer and use it in GitHub Desktop.
Save m-hayabusa/0e3f46f0afd7e96cd60296ed2e5cea4b to your computer and use it in GitHub Desktop.
OSCのメッセージをちぎって投げる
$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