diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/rtc_base/socket.h | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/rtc_base/socket.h')
-rw-r--r-- | third_party/libwebrtc/rtc_base/socket.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/third_party/libwebrtc/rtc_base/socket.h b/third_party/libwebrtc/rtc_base/socket.h index 0ed3a7fa6a..fac75aca94 100644 --- a/third_party/libwebrtc/rtc_base/socket.h +++ b/third_party/libwebrtc/rtc_base/socket.h @@ -13,6 +13,8 @@ #include <errno.h> +#include "absl/types/optional.h" + #if defined(WEBRTC_POSIX) #include <arpa/inet.h> #include <netinet/in.h> @@ -25,7 +27,10 @@ #include "rtc_base/win32.h" #endif +#include "api/units/timestamp.h" +#include "rtc_base/buffer.h" #include "rtc_base/socket_address.h" +#include "rtc_base/system/rtc_export.h" #include "rtc_base/third_party/sigslot/sigslot.h" // Rather than converting errors into a private namespace, @@ -78,8 +83,15 @@ inline bool IsBlockingError(int e) { // General interface for the socket implementations of various networks. The // methods match those of normal UNIX sockets very closely. -class Socket { +class RTC_EXPORT Socket { public: + struct ReceiveBuffer { + ReceiveBuffer(rtc::Buffer& payload) : payload(payload) {} + + absl::optional<webrtc::Timestamp> arrival_time; + SocketAddress source_address; + rtc::Buffer& payload; + }; virtual ~Socket() {} Socket(const Socket&) = delete; @@ -103,6 +115,10 @@ class Socket { size_t cb, SocketAddress* paddr, int64_t* timestamp) = 0; + // Intended to replace RecvFrom(void* ...). + // Default implementation calls RecvFrom(void* ...) with 64Kbyte buffer. + // Returns number of bytes received or a negative value on error. + virtual int RecvFrom(ReceiveBuffer& buffer); virtual int Listen(int backlog) = 0; virtual Socket* Accept(SocketAddress* paddr) = 0; virtual int Close() = 0; |