<commit_before>using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Collections.ObjectModel;

namespace Dx.Runtime
{
    public class Dht
    {
        private Contact p_Self = null;
        private List<Contact> p_Contacts = new List<Contact>();
        private IFormatter p_Formatter = null;
        private TcpListener m_TcpListener = null;
        private Thread m_TcpThread = null;
        private bool p_ShowDebug = false;
        private List<Entry> p_OwnedEntries = new List<Entry>();
        private object p_OwnedEntriesLock = new object();
        private object p_YieldingLock = new object();
        private bool m_Stopping = false;

        public const int TIMEOUT = 5;

        public event EventHandler<MessageEventArgs> OnReceived;
        public event EventHandler<EntriesRequestedEventArgs> OnEntriesRequested;

        public Dht(ID identifier, IPEndPoint endpoint)
            : this(identifier, endpoint, false)
        {
        }

        public Dht(ID identifier, IPEndPoint endpoint, bool debug)
        {
            this.p_Self = new Contact(identifier, endpoint);
            this.p_Formatter = new BinaryFormatter();
            this.p_ShowDebug = debug;

            // Start listening for events.
            this.m_TcpListener = new TcpListener(endpoint);
            this.m_TcpThread = new Thread(delegate()
            {
                while (true)
                {
                    try
                    {<commit_msg>Up the timeout so that large parameters / result data don't cause exceptions<commit_after>using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Collections.ObjectModel;

namespace Dx.Runtime
{
    public class Dht
    {
        private Contact p_Self = null;
        private List<Contact> p_Contacts = new List<Contact>();
        private IFormatter p_Formatter = null;
        private TcpListener m_TcpListener = null;
        private Thread m_TcpThread = null;
        private bool p_ShowDebug = false;
        private List<Entry> p_OwnedEntries = new List<Entry>();
        private object p_OwnedEntriesLock = new object();
        private object p_YieldingLock = new object();
        private bool m_Stopping = false;

        // TODO: This is 60 seconds for the moment to account for large parameters or
        // result data.  When the data is being sent or received, this counts towards
        // the timeout, even though in reality we should be aware that we've started
        // to receive a response from a node and therefore just have to wait until it
        // completes.
        public const int TIMEOUT = 60;

        public event EventHandler<MessageEventArgs> OnReceived;
        public event EventHandler<EntriesRequestedEventArgs> OnEntriesRequested;

        public Dht(ID identifier, IPEndPoint endpoint)
            : this(identifier, endpoint, false)
        {
        }

        public Dht(ID identifier, IPEndPoint endpoint, bool debug)
        {
            this.p_Self = new Contact(identifier, endpoint);
            this.p_Formatter = new BinaryFormatter();
            this.p_ShowDebug = debug;

            // Start listening for events.
            this.m_TcpListener = new TcpListener(endpoint);
            this.m_TcpThread = new Thread(delegate()
            {
                while (true)
                {
                    try
                    {
{'fraction_non_alphanumeric': 0.07051449464612171, 'fraction_numerical': 0.0013058239749281796, 'mean_word_length': 2.4014209591474245, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '7358291', 'n_tokens_mistral': 980, 'n_tokens_neox': 959, 'n_words': 309}