diff options
Diffstat (limited to 'include/lldb/Host/Socket.h')
-rw-r--r-- | include/lldb/Host/Socket.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/lldb/Host/Socket.h b/include/lldb/Host/Socket.h index 8b7f9fa4ed933..6f96bd73e753e 100644 --- a/include/lldb/Host/Socket.h +++ b/include/lldb/Host/Socket.h @@ -1,9 +1,8 @@ //===-- Socket.h ------------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -40,17 +39,20 @@ typedef int NativeSocket; class Socket : public IOObject { public: - typedef enum { + enum SocketProtocol { ProtocolTcp, ProtocolUdp, ProtocolUnixDomain, ProtocolUnixAbstract - } SocketProtocol; + }; static const NativeSocket kInvalidSocketValue; ~Socket() override; + static llvm::Error Initialize(); + static void Terminate(); + static std::unique_ptr<Socket> Create(const SocketProtocol protocol, bool child_processes_inherit, Status &error); @@ -100,6 +102,9 @@ public: std::string &host_str, std::string &port_str, int32_t &port, Status *error_ptr); + // If this Socket is connected then return the URI used to connect. + virtual std::string GetRemoteConnectionURI() const { return ""; }; + protected: Socket(SocketProtocol protocol, bool should_close, bool m_child_process_inherit); |