A data channel send that WriteSymmetricMessage refuses with limitsExceeded
returned without completing the send-gate ticket it had been handed. The
ticket then became the tail every later send chains behind, so MSG, OPN and
CLO for every Session on that SecureChannel stalled for good. Nothing
recovered from it: the scheduler logs a send fault rather than faulting the
channel, so the stall was silent. The ticket is now released on every path
out. Releasing twice is safe because the ticket completes under Interlocked.
MaxDataChannelBodySize approximated the chunk budget instead of computing it,
and missed the cipher block rounding WriteSymmetricMessage applies: a 65535
byte send buffer under a 16 byte block loses its last 15 bytes. A body at the
advertised size therefore spilled into a second chunk, which carries the
Intermediate chunk type that the frame codec rejects, after the SequenceNumber
had already been spent. It now mirrors that arithmetic.
The audio sample wrote to a fixed name under the shared temp directory and
truncated whatever was already there, so a local user could pre-create the
path as a symlink and have the sample overwrite the target. It now writes into
a directory created for the run and opens the file with CreateNew.
Both channel fixes are covered by tests proven to fail without them.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5d026b47-265d-4c97-8715-26e207dfa03c
Nine review comments; two were answered by the previous commit (the generic
extension seam and the file named after it are both gone). The rest:
Sample layout and a second sample
The data channel samples now live under samples/Core, and a new
ConsoleDataChannelAudio joins the throughput benchmark. It stands up a Server
and a Client in one process, synthesises a short melody as 16-bit PCM once at
startup and streams it on repeat over a data channel while the Client plays it
back. Nothing binary enters the repository.
The source writes in real time rather than as fast as the channel will take it,
because a media source is paced by its own clock and writing faster only adds
latency; the progress line reports frames, bytes and credit stalls so a
consumer that cannot keep up is visible rather than silently buffered. Measured
over 31 seconds: 1582 frames, 2725 KiB, zero credit stalls, which is exactly
real time for 20 ms frames.
Playback uses NAudio 2.3.0 (MIT), referenced only by that sample - nothing
under src/ gains a dependency. NAudio's output devices are Windows interfaces
and 2.x has no ALSA or CoreAudio backend, so on Linux and macOS the sample
writes the received stream to a WAV instead and says which it is doing on
startup. The Windows-only paths sit behind OperatingSystem.IsWindows() rather
than a CA1416 suppression.
Documentation
"Where the code lives" describes where the code is rather than where it moved
from, and the same edit removes "rather than in ...", "remains" and the rest of
the change narration. Two sections that were a development diary - the tables
of defects found while writing tests and while running the sample - are gone
entirely: they recorded history rather than the state of the implementation.
Logging
The response-dispatched callback logged through a message that reads "Failed to
send fault response to client", which is not what happened, and on the HTTPS
listener it invented a requestId of 0 to fit that signature. All three
listeners now have a named message that says what actually failed.
net8.0 for the QUIC binding
Rather than excluding net8.0, the binding targets it and enables preview
features, so a net8.0 consumer opts in the same way for System.Net.Quic. The
three file-wide NET9_0_OR_GREATER guards are gone; only
QuicServerConnectionOptions.HandshakeTimeout stays guarded because it is
genuinely .NET 9+, and the listener's own admission expiry still bounds a
stalled handshake there.
Removing the #if around [Experimental]
ExperimentalAttribute is a .NET 8 type, and the repo's rule is to polyfill
rather than fork with #if, so it joins the existing polyfills in
Opc.Ua.Types. Verified that this is a real opt-in and not just something that
compiles: with the suppression removed, a net48 caller of a data channel
Service fails the build with "error DataChannels", which is the same behaviour
as net10.0.
Validated with the matrix CI runs: all seven pinned UA.slnx builds (net10.0,
net9.0, net8.0, net48, net472, netstandard2.0, netstandard2.1), 316 data
channel tests on net10.0 and 242 on net48, Opc.Ua.Server.Tests 4072,
Opc.Ua.Client.Tests 2126, Opc.Ua.Redundancy.Client.Tests 123, and the reference
server Docker image end to end.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5d026b47-265d-4c97-8715-26e207dfa03c