1 //===-- UDPSocket.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 9 #ifndef LLDB_HOST_COMMON_UDPSOCKET_H 10 #define LLDB_HOST_COMMON_UDPSOCKET_H 11 12 #include "lldb/Host/Socket.h" 13 14 namespace lldb_private { 15 class UDPSocket : public Socket { 16 public: 17 UDPSocket(bool should_close, bool child_processes_inherit); 18 19 static llvm::Expected<std::unique_ptr<UDPSocket>> 20 Connect(llvm::StringRef name, bool child_processes_inherit); 21 22 std::string GetRemoteConnectionURI() const override; 23 24 private: 25 UDPSocket(NativeSocket socket); 26 27 size_t Send(const void *buf, const size_t num_bytes) override; 28 Status Connect(llvm::StringRef name) override; 29 Status Listen(llvm::StringRef name, int backlog) override; 30 Status Accept(Socket *&socket) override; 31 32 SocketAddress m_sockaddr; 33 }; 34 } 35 36 #endif // LLDB_HOST_COMMON_UDPSOCKET_H 37