diff options
Diffstat (limited to 'include/perfetto/ext/base/unix_socket.h')
-rw-r--r-- | include/perfetto/ext/base/unix_socket.h | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/include/perfetto/ext/base/unix_socket.h b/include/perfetto/ext/base/unix_socket.h index 07e0f584f..df0cad87f 100644 --- a/include/perfetto/ext/base/unix_socket.h +++ b/include/perfetto/ext/base/unix_socket.h @@ -181,8 +181,6 @@ class UnixSocket { kListening // After Listen(), until Shutdown(). }; - enum class BlockingMode { kNonBlocking, kBlocking }; - // Creates a socket and starts listening. If SockFamily::kUnix and // |socket_name| starts with a '@', an abstract UNIX dmoain socket will be // created instead of a filesystem-linked UNIX socket (Linux/Android only). @@ -242,26 +240,16 @@ class UnixSocket { // EventListener::OnDisconnect() will be called. // If the socket is not connected, Send() will just return false. // Does not append a null string terminator to msg in any case. - // - // DO NOT PASS kNonBlocking, it is broken. - bool Send(const void* msg, - size_t len, - const int* send_fds, - size_t num_fds, - BlockingMode blocking = BlockingMode::kNonBlocking); - - inline bool Send(const void* msg, - size_t len, - int send_fd = -1, - BlockingMode blocking = BlockingMode::kNonBlocking) { + bool Send(const void* msg, size_t len, const int* send_fds, size_t num_fds); + + inline bool Send(const void* msg, size_t len, int send_fd = -1) { if (send_fd != -1) - return Send(msg, len, &send_fd, 1, blocking); - return Send(msg, len, nullptr, 0, blocking); + return Send(msg, len, &send_fd, 1); + return Send(msg, len, nullptr, 0); } - inline bool Send(const std::string& msg, - BlockingMode blocking = BlockingMode::kNonBlocking) { - return Send(msg.c_str(), msg.size() + 1, -1, blocking); + inline bool Send(const std::string& msg) { + return Send(msg.c_str(), msg.size() + 1, -1); } // Returns the number of bytes (<= |len|) written in |msg| or 0 if there |