diff options
author | Cronet Mainline Eng <cronet-mainline-eng+copybara@google.com> | 2023-04-17 14:36:25 -0800 |
---|---|---|
committer | Patrick Rohr <prohr@google.com> | 2023-04-17 15:41:30 -0700 |
commit | 41cb724250484f326b0bbd5f8b955eb37b3b83c6 (patch) | |
tree | cb7b2cbe08b2c5305a56b31649359f8141edd198 /net/socket/udp_socket_posix.h | |
parent | c175721cfcc03e339122be17d569239df9762b2b (diff) | |
download | cronet-41cb724250484f326b0bbd5f8b955eb37b3b83c6.tar.gz |
Import Cronet version 114.0.5709.3
Project import generated by Copybara.
FolderOrigin-RevId: /tmp/copybara-origin/src
Test: none
Change-Id: I263aa6b692a17ac2471b98b6e662b26dd1327c9c
Diffstat (limited to 'net/socket/udp_socket_posix.h')
-rw-r--r-- | net/socket/udp_socket_posix.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/socket/udp_socket_posix.h b/net/socket/udp_socket_posix.h index 306feb8ab..59eb51499 100644 --- a/net/socket/udp_socket_posix.h +++ b/net/socket/udp_socket_posix.h @@ -99,7 +99,6 @@ class NET_EXPORT UDPSocketPosix { int Bind(const IPEndPoint& address); // Closes the socket. - // TODO(rvargas, hidehiko): Disallow re-Open() after Close(). void Close(); // Copies the remote udp address into |address| and returns a net error code. @@ -272,8 +271,10 @@ class NET_EXPORT UDPSocketPosix { // Sets iOS Network Service Type for option SO_NET_SERVICE_TYPE. int SetIOSNetworkServiceType(int ios_network_service_type); - // Sets "don't close" flag for the socket. - void SetDontClose(bool dont_close); + // Takes ownership of `socket`, which should be a socket descriptor opened + // with the specified address family. The socket should only be created but + // not bound or connected to an address. + int AdoptOpenedSocket(AddressFamily address_family, int socket); private: enum SocketOptions { @@ -368,6 +369,9 @@ class NET_EXPORT UDPSocketPosix { // Binds to a random port on |address|. int RandomBind(const IPAddress& address); + // Sets `socket_hash_` and `tag_` on opened `socket_`. + int ConfigureOpenedSocket(); + int socket_; // Hash of |socket_| to verify that it is not corrupted when calling close(). @@ -454,9 +458,6 @@ class NET_EXPORT UDPSocketPosix { // UDPSocket is destroyed. OwnedUDPSocketCount owned_socket_count_; - // Flag to signify if |socket_| should not be closed. - bool dont_close_ = false; - THREAD_CHECKER(thread_checker_); }; |