<commit_before>//===-- ConnectionFileDescriptorPosix.h -------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_Host_posix_ConnectionFileDescriptorPosix_h_
#define liblldb_Host_posix_ConnectionFileDescriptorPosix_h_

// C++ Includes
#include <atomic>
#include <memory>

#include "lldb/lldb-forward.h"

// Other libraries and framework includes
// Project includes
#include "lldb/Core/Connection.h"
#include "lldb/Host/Mutex.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Host/Predicate.h"
#include "lldb/Host/IOObject.h"

namespace lldb_private
{

class Error;
class Socket;
class SocketAddress;

class ConnectionFileDescriptor : public Connection
{
  public:
    ConnectionFileDescriptor(bool child_processes_inherit = false);

    ConnectionFileDescriptor(int fd, bool owns_fd);

    virtual ~ConnectionFileDescriptor();

    virtual bool IsConnected() const;

    virtual lldb::ConnectionStatus Connect(const char *s, Error *error_ptr);

    virtual lldb::ConnectionStatus Disconnect(Error *error_ptr);

    virtual size_t Read(void *dst, size_t dst_len, uint32_t timeout_usec, lldb::ConnectionStatus &status, Error *error_ptr);

    virtual size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr);

    virtual std::string GetURI();

    lldb::ConnectionStatus BytesAvailable(uint32_t timeout_usec, Error *error_ptr);

    bool InterruptRead() override;

    lldb::IOObjectSP
    GetReadObject()
    {
        return m_read_sp;
    }
    const lldb::IOObjectSP
    GetReadObject() const
    {
        return m_read_sp;
    }

    uint16_t GetListeningPort(uint32_t timeout_sec);

    bool GetChildProcessesInherit() const;
    void SetChildProcessesInherit(bool child_processes_inherit);

  protected:
    void OpenCommandPipe();

    void CloseCommandPipe();

    lldb::ConnectionStatus SocketListenAndAccept(const char *host_and_port, Error *error_ptr);

    lldb::ConnectionStatus ConnectTCP(const char *host_and_port, Error *error_ptr);

    lldb::ConnectionStatus ConnectUDP(const char *args, Error *error_ptr);<commit_msg>Add override markers<commit_after>//===-- ConnectionFileDescriptorPosix.h -------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_Host_posix_ConnectionFileDescriptorPosix_h_
#define liblldb_Host_posix_ConnectionFileDescriptorPosix_h_

// C++ Includes
#include <atomic>
#include <memory>

#include "lldb/lldb-forward.h"

// Other libraries and framework includes
// Project includes
#include "lldb/Core/Connection.h"
#include "lldb/Host/Mutex.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Host/Predicate.h"
#include "lldb/Host/IOObject.h"

namespace lldb_private
{

class Error;
class Socket;
class SocketAddress;

class ConnectionFileDescriptor : public Connection
{
  public:
    ConnectionFileDescriptor(bool child_processes_inherit = false);

    ConnectionFileDescriptor(int fd, bool owns_fd);

    virtual ~ConnectionFileDescriptor();

    bool IsConnected() const override;

    lldb::ConnectionStatus Connect(const char *s, Error *error_ptr) override;

    lldb::ConnectionStatus Disconnect(Error *error_ptr) override;

    size_t Read(void *dst, size_t dst_len, uint32_t timeout_usec, lldb::ConnectionStatus &status, Error *error_ptr) override;

    size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr) override;

    std::string GetURI() override;

    lldb::ConnectionStatus BytesAvailable(uint32_t timeout_usec, Error *error_ptr);

    bool InterruptRead() override;

    lldb::IOObjectSP
    GetReadObject()
    {
        return m_read_sp;
    }
    const lldb::IOObjectSP
    GetReadObject() const
    {
        return m_read_sp;
    }

    uint16_t GetListeningPort(uint32_t timeout_sec);

    bool GetChildProcessesInherit() const;
    void SetChildProcessesInherit(bool child_processes_inherit);

  protected:
    void OpenCommandPipe();

    void CloseCommandPipe();

    lldb::ConnectionStatus SocketListenAndAccept(const char *host_and_port, Error *error_ptr);

    lldb::ConnectionStatus ConnectTCP(const char *host_and_port, Error *error_ptr);

    lldb::ConnectionStatus ConnectUDP(const char *args, Error *error_ptr);
{'fraction_non_alphanumeric': 0.13812272824460123, 'fraction_numerical': 0.003420996365191362, 'mean_word_length': 3.6179664363277393, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673495', 'n_tokens_mistral': 1451, 'n_tokens_neox': 1401, 'n_words': 331}