Skip to content

UDP: receive datagrams up to the IPv4 maximum, a larger one than the … - #428

Merged
janwilmans merged 1 commit into
mainfrom
develop
Nov 4, 2026
Merged

janwilmans merged 1 commit into
mainfrom
develop

Conversation

@janwilmans

Copy link
Copy Markdown
Collaborator

…2000-byte buffer ended all capture

The UDP source received into a 2000-byte buffer. A larger datagram fails the receive with WSAEMSGSIZE, that exception is rethrown on the thread that reads all sources, an "Exception occurred" box is shown, and the program ends when it is closed. Log frameworks send larger datagrams routinely, log4net's UdpAppender sends an exception with its stack trace as a single datagram, so DebugView++ could not be used as a UDP log viewer.

The buffer is now 65536 bytes, room for the largest UDP datagram over IPv4 (65507 bytes), so the receive can no longer fail this way.

LogSourceUdpReaderReceivesLargeDatagrams sends datagrams of 100, 2000, 2001, 10000 and 65507 bytes to a UDP reader and expects all of them. With the old buffer it receives only the first two.

…2000-byte buffer ended all capture

The UDP source received into a 2000-byte buffer. A larger datagram fails the receive with WSAEMSGSIZE, that
exception is rethrown on the thread that reads all sources, an "Exception occurred" box is shown, and the
program ends when it is closed. Log frameworks send larger datagrams routinely, log4net's UdpAppender sends
an exception with its stack trace as a single datagram, so DebugView++ could not be used as a UDP log viewer.

The buffer is now 65536 bytes, room for the largest UDP datagram over IPv4 (65507 bytes), so the receive can
no longer fail this way.

LogSourceUdpReaderReceivesLargeDatagrams sends datagrams of 100, 2000, 2001, 10000 and 65507 bytes to a UDP
reader and expects all of them. With the old buffer it receives only the first two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@janwilmans
janwilmans merged commit 4cec556 into main Nov 4, 2026
1 check passed
@janwilmans
janwilmans deleted the develop branch November 4, 2026 08:46
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.

2 participants