#if defined(_MSC_VER)
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#endif
#include "lldb/Host/common/TCPSocket.h"
#include "lldb/Host/Config.h"
#include "lldb/Host/MainLoop.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/WindowsError.h"
#include "llvm/Support/raw_ostream.h"
#if LLDB_ENABLE_POSIX
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#endif
#if defined(_WIN32)
#include <winsock2.h>
#endif
usingnamespacelldb;
usingnamespacelldb_private;
static const int kType = …;
TCPSocket::TCPSocket(bool should_close, bool child_processes_inherit)
: … { … }
TCPSocket::TCPSocket(NativeSocket socket, const TCPSocket &listen_socket)
: … { … }
TCPSocket::TCPSocket(NativeSocket socket, bool should_close,
bool child_processes_inherit)
: … { … }
TCPSocket::~TCPSocket() { … }
bool TCPSocket::IsValid() const { … }
uint16_t TCPSocket::GetLocalPortNumber() const { … }
std::string TCPSocket::GetLocalIPAddress() const { … }
uint16_t TCPSocket::GetRemotePortNumber() const { … }
std::string TCPSocket::GetRemoteIPAddress() const { … }
std::string TCPSocket::GetRemoteConnectionURI() const { … }
Status TCPSocket::CreateSocket(int domain) { … }
Status TCPSocket::Connect(llvm::StringRef name) { … }
Status TCPSocket::Listen(llvm::StringRef name, int backlog) { … }
void TCPSocket::CloseListenSockets() { … }
llvm::Expected<std::vector<MainLoopBase::ReadHandleUP>>
TCPSocket::Accept(MainLoopBase &loop,
std::function<void(std::unique_ptr<Socket> socket)> sock_cb) { … }
int TCPSocket::SetOptionNoDelay() { … }
int TCPSocket::SetOptionReuseAddress() { … }