martinzink commented on code in PR #1457:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1457#discussion_r1066877738
##########
libminifi/src/utils/net/UdpServer.cpp:
##########
@@ -15,32 +15,39 @@
* limitations under the License.
*/
#include "utils/net/UdpServer.h"
+#include "asio/use_awaitable.hpp"
+#include "asio/detached.hpp"
+#include "utils/net/AsioCoro.h"
namespace org::apache::nifi::minifi::utils::net {
+constexpr size_t MAX_UDP_PACKET_SIZE = 65535;
+
UdpServer::UdpServer(std::optional<size_t> max_queue_size,
uint16_t port,
std::shared_ptr<core::logging::Logger> logger)
- : Server(max_queue_size, std::move(logger)),
- socket_(io_context_, asio::ip::udp::endpoint(asio::ip::udp::v6(), port))
{
- doReceive();
+ : Server(max_queue_size, port, std::move(logger)) {
}
+asio::awaitable<void> UdpServer::listen() {
Review Comment:
You are right, I reverted back to doReceive() in
https://github.com/apache/nifi-minifi-cpp/pull/1457/commits/ba31387396eace85fafa762252f174abf0adf04a,
and I agree this UDP part could be much simpler (relying on the OS udp queue),
but I feel like refactoring that is out of the scope of this PR. I created a
jira issue to investigate this further.
https://issues.apache.org/jira/browse/MINIFICPP-2031
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]