003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/include/lldb/Host
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
include
/
lldb
/
Host
/
📁
..
📄
Config.h.cmake
(1.2 KB)
📄
ConnectionFileDescriptor.h
(528 B)
📄
Debug.h
(4.44 KB)
📄
Editline.h
(12.4 KB)
📄
File.h
(15.26 KB)
📄
FileAction.h
(1.35 KB)
📄
FileCache.h
(1.29 KB)
📄
FileSystem.h
(6.84 KB)
📄
Host.h
(10.04 KB)
📄
HostGetOpt.h
(699 B)
📄
HostInfo.h
(2.6 KB)
📄
HostInfoBase.h
(4.05 KB)
📄
HostNativeProcess.h
(728 B)
📄
HostNativeProcessBase.h
(1.43 KB)
📄
HostNativeThread.h
(690 B)
📄
HostNativeThreadBase.h
(1.46 KB)
📄
HostNativeThreadForward.h
(753 B)
📄
HostProcess.h
(1.7 KB)
📄
HostThread.h
(1.32 KB)
📄
LZMA.h
(883 B)
📄
LockFile.h
(704 B)
📄
LockFileBase.h
(1.52 KB)
📄
MainLoop.h
(3.83 KB)
📄
MainLoopBase.h
(2.91 KB)
📄
MonitoringProcessLauncher.h
(1.12 KB)
📄
OptionParser.h
(1.51 KB)
📄
Pipe.h
(668 B)
📄
PipeBase.h
(2.26 KB)
📄
PosixApi.h
(743 B)
📄
ProcessLaunchInfo.h
(5.36 KB)
📄
ProcessLauncher.h
(735 B)
📄
ProcessRunLock.h
(2.02 KB)
📄
PseudoTerminal.h
(8.45 KB)
📄
SafeMachO.h
(3.25 KB)
📄
Socket.h
(4.56 KB)
📄
SocketAddress.h
(5.77 KB)
📄
StringConvert.h
(1.26 KB)
📄
Terminal.h
(5.12 KB)
📄
ThreadLauncher.h
(1.39 KB)
📄
Time.h
(718 B)
📄
XML.h
(4.7 KB)
📁
common
📁
freebsd
📁
netbsd
📁
openbsd
📁
posix
Editing: Socket.h
//===-- Socket.h ------------------------------------------------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_SOCKET_H #define LLDB_HOST_SOCKET_H #include <memory> #include <string> #include "lldb/lldb-private.h" #include "lldb/Host/SocketAddress.h" #include "lldb/Utility/IOObject.h" #include "lldb/Utility/Predicate.h" #include "lldb/Utility/Status.h" #ifdef _WIN32 #include "lldb/Host/windows/windows.h" #include <winsock2.h> #include <ws2tcpip.h> #endif namespace llvm { class StringRef; } namespace lldb_private { #if defined(_WIN32) typedef SOCKET NativeSocket; #else typedef int NativeSocket; #endif class TCPSocket; class UDPSocket; class Socket : public IOObject { public: enum SocketProtocol { ProtocolTcp, ProtocolUdp, ProtocolUnixDomain, ProtocolUnixAbstract }; 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); virtual Status Connect(llvm::StringRef name) = 0; virtual Status Listen(llvm::StringRef name, int backlog) = 0; virtual Status Accept(Socket *&socket) = 0; // Initialize a Tcp Socket object in listening mode. listen and accept are // implemented separately because the caller may wish to manipulate or query // the socket after it is initialized, but before entering a blocking accept. static llvm::Expected<std::unique_ptr<TCPSocket>> TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit, Predicate<uint16_t> *predicate, int backlog = 5); static llvm::Expected<std::unique_ptr<Socket>> TcpConnect(llvm::StringRef host_and_port, bool child_processes_inherit); static llvm::Expected<std::unique_ptr<UDPSocket>> UdpConnect(llvm::StringRef host_and_port, bool child_processes_inherit); static Status UnixDomainConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Status UnixDomainAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Status UnixAbstractConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Status UnixAbstractAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); int GetOption(int level, int option_name, int &option_value); int SetOption(int level, int option_name, int option_value); NativeSocket GetNativeSocket() const { return m_socket; } SocketProtocol GetSocketProtocol() const { return m_protocol; } Status Read(void *buf, size_t &num_bytes) override; Status Write(const void *buf, size_t &num_bytes) override; virtual Status PreDisconnect(); Status Close() override; bool IsValid() const override { return m_socket != kInvalidSocketValue; } WaitableHandle GetWaitableHandle() override; static bool DecodeHostAndPort(llvm::StringRef host_and_port, 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); virtual size_t Send(const void *buf, const size_t num_bytes); static void SetLastError(Status &error); static NativeSocket CreateSocket(const int domain, const int type, const int protocol, bool child_processes_inherit, Status &error); static NativeSocket AcceptSocket(NativeSocket sockfd, struct sockaddr *addr, socklen_t *addrlen, bool child_processes_inherit, Status &error); SocketProtocol m_protocol; NativeSocket m_socket; bool m_child_processes_inherit; bool m_should_close_fd; }; } // namespace lldb_private #endif // LLDB_HOST_SOCKET_H
Upload File
Create Folder