Delete AsyncSocket class, merge into Socket class

Bug: webrtc:13065
Change-Id: I13afee2386ea9c4de0e4fa95133f0c4d3ec826e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227031
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34787}
This commit is contained in:
Niels Möller
2021-08-12 10:32:30 +02:00
committed by WebRTC LUCI CQ
parent 45b3e530cb
commit d0b8879770
73 changed files with 570 additions and 685 deletions

View File

@ -16,7 +16,6 @@
#include <memory>
#include "rtc_base/async_packet_socket.h"
#include "rtc_base/async_socket.h"
#include "rtc_base/socket.h"
#include "rtc_base/socket_address.h"
#include "rtc_base/socket_factory.h"
@ -30,13 +29,13 @@ class AsyncUDPSocket : public AsyncPacketSocket {
// Binds `socket` and creates AsyncUDPSocket for it. Takes ownership
// of `socket`. Returns null if bind() fails (`socket` is destroyed
// in that case).
static AsyncUDPSocket* Create(AsyncSocket* socket,
static AsyncUDPSocket* Create(Socket* socket,
const SocketAddress& bind_address);
// Creates a new socket for sending asynchronous UDP packets using an
// asynchronous socket from the given factory.
static AsyncUDPSocket* Create(SocketFactory* factory,
const SocketAddress& bind_address);
explicit AsyncUDPSocket(AsyncSocket* socket);
explicit AsyncUDPSocket(Socket* socket);
~AsyncUDPSocket() override;
SocketAddress GetLocalAddress() const override;
@ -58,11 +57,11 @@ class AsyncUDPSocket : public AsyncPacketSocket {
private:
// Called when the underlying socket is ready to be read from.
void OnReadEvent(AsyncSocket* socket);
void OnReadEvent(Socket* socket);
// Called when the underlying socket is ready to send.
void OnWriteEvent(AsyncSocket* socket);
void OnWriteEvent(Socket* socket);
std::unique_ptr<AsyncSocket> socket_;
std::unique_ptr<Socket> socket_;
char* buf_;
size_t size_;
};