Revert "Take out listen support from AsyncPacketSocket"
This reverts commit b141c162ee2ef88a7498ba8cb8bc852287f93ad2.
Reason for revert: Breaking WebRTC rolls. See https://ci.chromium.org/ui/b/8832847811929676465 for an example failed build.
Original change's description:
> Take out listen support from AsyncPacketSocket
>
> Moved to new interface class AsyncListenSocket.
>
> Bug: webrtc:13065
> Change-Id: Ib96ce154ba19979360ecd8144981d947ff5b8b18
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/232607
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35234}
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: webrtc:13065
Change-Id: Id5d5b35cb21704ca4e3006caf1636906df062609
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235824
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35249}
diff --git a/rtc_base/async_packet_socket.h b/rtc_base/async_packet_socket.h
index ce36dd6..8362604 100644
--- a/rtc_base/async_packet_socket.h
+++ b/rtc_base/async_packet_socket.h
@@ -128,31 +128,17 @@
// CONNECTED to CLOSED.
sigslot::signal2<AsyncPacketSocket*, int> SignalClose;
+ // Used only for listening TCP sockets.
+ sigslot::signal2<AsyncPacketSocket*, AsyncPacketSocket*> SignalNewConnection;
+
private:
RTC_DISALLOW_COPY_AND_ASSIGN(AsyncPacketSocket);
};
-// Listen socket, producing an AsyncPacketSocket when a peer connects.
-class RTC_EXPORT AsyncListenSocket : public sigslot::has_slots<> {
- public:
- enum class State {
- kClosed,
- kBound,
- };
-
- // Returns current state of the socket.
- virtual State GetState() const = 0;
-
- // Returns current local address. Address may be set to null if the
- // socket is not bound yet (GetState() returns kBinding).
- virtual SocketAddress GetLocalAddress() const = 0;
-
- // Get/set options.
- virtual int GetOption(Socket::Option opt, int* value) = 0;
- virtual int SetOption(Socket::Option opt, int value) = 0;
-
- sigslot::signal2<AsyncListenSocket*, AsyncPacketSocket*> SignalNewConnection;
-};
+// TODO(bugs.webrtc.org/13065): Intended to be broken out into a separate class,
+// after downstream has adapted the new name. The main feature to move from
+// AsyncPacketSocket to AsyncListenSocket is the SignalNewConnection.
+using AsyncListenSocket = AsyncPacketSocket;
void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
const AsyncPacketSocket& socket_from,