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}
This commit is contained in:
Evan Shrubsole
2021-10-20 15:01:56 +00:00
committed by WebRTC LUCI CQ
parent b4d4ae2c23
commit 1f30c2ba9b
11 changed files with 121 additions and 178 deletions

View File

@ -128,31 +128,17 @@ class RTC_EXPORT AsyncPacketSocket : public sigslot::has_slots<> {
// 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,