Open
Conversation
| class udp | ||
| : public std::enable_shared_from_this<udp> | ||
| , public isocket | ||
| class udp_base |
Check warning
Code scanning / CodeQL
Non-virtual destructor in base class
Comment on lines
+267
to
+273
| /* TRACE - enable if necessary for development | ||
| for (int i = 0; i < res; ++i) | ||
| { | ||
| std::cout << "[" << (*bufsizes[i]) << "]"; | ||
| } | ||
| std::cout << std::endl; | ||
| */ |
Check notice
Code scanning / CodeQL
Commented-out code
Comment on lines
+190
to
+194
| if (val[0] == "bulk") | ||
| ::xtransmit::g_udp_mode_bulk = true; | ||
| return true; | ||
| }, | ||
| "UDP mode: simple or bulk [Linux only]"); |
Owner
There was a problem hiding this comment.
To detect possible typos (if returning false results in an error):
else if (val[0] != "simple")
return false;
| udp(const UriParser &src_uri); | ||
| ~udp(); | ||
| udp_base(const UriParser &src_uri); | ||
| ~udp_base(); |
Owner
There was a problem hiding this comment.
Suggested change
| ~udp_base(); | |
| virtual ~udp_base(); |
Comment on lines
+220
to
+235
| while (!m_blocking_mode) | ||
| { | ||
| fd_set set; | ||
| timeval tv; | ||
| FD_ZERO(&set); | ||
| FD_SET(m_bind_socket, &set); | ||
| tv.tv_sec = 0; | ||
| tv.tv_usec = 10000; | ||
| const int select_ret = ::select((int)m_bind_socket + 1, &set, NULL, &set, &tv); | ||
|
|
||
| if (select_ret != 0) // ready | ||
| break; | ||
|
|
||
| if (timeout_ms >= 0) // timeout | ||
| return 0; | ||
| } |
Owner
There was a problem hiding this comment.
No need to block if there is a cached buffer to read.
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.
Added "bulk mode" UDP reader. This is implemented as a separate
socket::mudpclass which usesrecvmmsgfor reading multiple packets if available.Packets are stored in a local buffer and are returned from cache. The call to the system function refills the cache.
Available only on Linux.
You need to enable it (instead of the standard UDP reader) by
--udp-mode bulkoption.