[LoongArch] Add codegen support for multiplication operations
[llvm-project.git] / lldb / tools / lldb-server / Acceptor.h
blobb441e92dcd22f3b5191ffffbbb1e53611288349f
1 //===-- Acceptor.h ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLDB_TOOLS_LLDB_SERVER_ACCEPTOR_H
9 #define LLDB_TOOLS_LLDB_SERVER_ACCEPTOR_H
11 #include "lldb/Host/Socket.h"
12 #include "lldb/Utility/Connection.h"
13 #include "lldb/Utility/Status.h"
15 #include <functional>
16 #include <memory>
17 #include <string>
19 namespace llvm {
20 class StringRef;
23 namespace lldb_private {
24 namespace lldb_server {
26 class Acceptor {
27 public:
28 virtual ~Acceptor() = default;
30 Status Listen(int backlog);
32 Status Accept(const bool child_processes_inherit, Connection *&conn);
34 static std::unique_ptr<Acceptor> Create(llvm::StringRef name,
35 const bool child_processes_inherit,
36 Status &error);
38 Socket::SocketProtocol GetSocketProtocol() const;
40 const char *GetSocketScheme() const;
42 // Returns either TCP port number as string or domain socket path.
43 // Empty string is returned in case of error.
44 std::string GetLocalSocketId() const;
46 private:
47 typedef std::function<std::string()> LocalSocketIdFunc;
49 Acceptor(std::unique_ptr<Socket> &&listener_socket, llvm::StringRef name,
50 const LocalSocketIdFunc &local_socket_id);
52 const std::unique_ptr<Socket> m_listener_socket_up;
53 const std::string m_name;
54 const LocalSocketIdFunc m_local_socket_id;
57 } // namespace lldb_server
58 } // namespace lldb_private
60 #endif // LLDB_TOOLS_LLDB_SERVER_ACCEPTOR_H