UDPSocket.h 1.1 KB

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