Skip to content

feat(vmnet): add packets available callback - #236

Closed
Code-Hex wants to merge 1 commit into
codex/vmnet-packetsfrom
codex/vmnet-events
Closed

Code-Hex wants to merge 1 commit into
codex/vmnet-packetsfrom
codex/vmnet-events

Conversation

@Code-Hex

Copy link
Copy Markdown
Owner

概要

PR #205 のパケット到着通知を、パケット入出力 PR #234 の上に切り出します。元の 43fded6 を基にしています。

  • SetPacketsAvailableEventCallback で通知を登録し、nil で解除できます。
  • Interface.Stop 時にも通知を解除し、進行中のシリアルキュー処理が終わった後に cgo ハンドルを解放します。
  • コールバック自身からの解除を実機で確認します。

確認

  • 署名付き TestPacketsAvailableEventCallback を 5 回実行して通過
  • 同テストを -race で 2 回実行して通過
  • go test ./... -run '^$' で全パッケージのコンパイルが通過

元 PR: #205

Register one callback per interface and release its cgo handle after the event queue drains. Clear callbacks before stopping the interface, and allow a callback to remove itself.

Adapted from PR #205, commit 43fded6.

Co-authored-by: Norio Nomura <norio.nomura@gmail.com>
@Code-Hex Code-Hex closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant