Fix #recvfrom to match stdlib#83
Open
zeroSteiner wants to merge 5 commits into
Open
Conversation
4 tasks
3 tasks
Make Rex::Socket::Udp#recvfrom a true drop-in for stdlib UDPSocket#recvfrom: it now blocks until a datagram arrives (no internal def_read_timeout / Errno::EAGAIN deadline) and returns [ data, [address_family, port, host, host] ]. Callers that need a deadline use the new #timed_recvfrom, which returns the same stdlib-shaped tuple and nil when the timeout elapses -- mirroring the read/timed_read pair. #timed_read is left as-is. Co-Authored-By: Claude Opus 4.8 <[email protected]>
480f12c to
1c1e60b
Compare
9 tasks
zeroSteiner
added a commit
to zeroSteiner/metasploit-framework
that referenced
this pull request
Jun 11, 2026
This pulls in changes from rapid7/rex-socket#83 which aligns #recvfrom to match the signature and behavior of the standard library in regards to it's arguments, return type and how it handles timeouts. The historical usage of #recvfrom was a timed read and can now be replaced with #timed_recvfrom.
zeroSteiner
added a commit
to zeroSteiner/metasploit-framework
that referenced
this pull request
Jun 11, 2026
This pulls in changes from rapid7/rex-socket#83 which aligns #recvfrom to match the signature and behavior of the standard library in regards to it's arguments, return type and how it handles timeouts. The historical usage of #recvfrom was a timed read and can now be replaced with #timed_recvfrom.
sjanusz-r7
reviewed
Jun 16, 2026
sjanusz-r7
approved these changes
Jun 17, 2026
zeroSteiner
added a commit
to zeroSteiner/metasploit-framework
that referenced
this pull request
Jun 17, 2026
This pulls in changes from rapid7/rex-socket#83 which aligns #recvfrom to match the signature and behavior of the standard library in regards to it's arguments, return type and how it handles timeouts. The historical usage of #recvfrom was a timed read and can now be replaced with #timed_recvfrom.
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 is related to #82 but unlike #82, this is a breaking change. It updates the
#recvfromsignature to match that of the standard library. This was raised first here: rapid7/metasploit-framework#20689 (comment) and was highlighted by the condition required here: https://github.com/Z6543/ruby_smb/blob/679da4dba6bb4256ff1b79527d5d0c6f8cc6fd76/lib/ruby_smb/nbss/node_status.rb#L215-L224