network_tester: Remove usage of rtc::Thread::socketserver() and cleanup

Instead of creating a TaskQueue from packet_sender, create a rtc::Thread
in test_controller so that test_controller instantiates a SocketServer,
eliminating the use of rtc::Thread::socketserver().
Also did various cleanups, such as adding threading annotations, and
ensuring that all network operations are done in dedicated threads.

Bug: webrtc:13145
Test: Unittest, and manually verified using Android clients and Linux servers
Change-Id: I05ebe5e29bd80f14a193c9ee8b0bf63a1b6b94d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263321
Commit-Queue: Daniel.l Lee <daniel.l@hpcnt.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37411}
This commit is contained in:
Byoungchan Lee
2022-07-03 17:20:17 +09:00
committed by WebRTC LUCI CQ
parent c3f511301b
commit c931f70896
9 changed files with 130 additions and 64 deletions

View File

@ -8,13 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "rtc_base/null_socket_server.h"
#include "rtc_tools/network_tester/test_controller.h"
int main(int /*argn*/, char* /*argv*/[]) {
rtc::Thread main_thread(std::make_unique<rtc::NullSocketServer>());
webrtc::TestController server(9090, 9090, "server_config.dat",
"server_packet_log.dat");
while (!server.IsTestDone()) {
server.Run();
// 100 ms is arbitrary chosen.
main_thread.ProcessMessages(/*cms=*/100);
}
return 0;
}