Draft
Add context-managed realtime packet session with RT-kernel mode#39
Conversation
Copilot created this pull request from a session on behalf of
polybassa
May 27, 2026 04:13
View session
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces a reusable realtime send/receive session API for Scapy and adds an explicit
rt_kernel=Truemode for lower-jitter, deterministic I/O behavior on real-time kernels. The goal is to support interactive packet workflows with clear socket lifecycle, configurable latency controls, and RT-safe integration points.API: context-managed realtime session
RealtimeSessionandrealtime_session(...)inscapy/sendrecv.py.send(),recv(timeout=...), andsendrecv(...).Execution model split by mode
rt_kernel=True: single-threaded blocking receive path on the same socket to reduce scheduler jitter.RT tuning + integration hooks
socket_rcvbuf,socket_sndbuf,poll_interval,queue_size,strict_drop.setup_callback/teardown_callbackhooks so callers can apply external process-level RT setup (e.g., scheduler/affinity) outside Scapy core.Docs: realtime-kernel caveats
doc/scapy/usage.rstcovering API usage, mode behavior, tuning options, and RT operational caveats (privileges, starvation risk, latency-vs-completeness tradeoff).Regression coverage
test/regression.utsscenarios for:send()requires entered context) andsendrecv()flow.