<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using RailNet.Clients.Ecos.Basic;
using RailNet.Clients.Ecos.Network;
using RailNet.Core;
using TinyIoC;

namespace RailNet.Clients.Ecos
{
    public class RailClient : RailNetClientBase
    {
        private readonly TinyIoCContainer container;

        private INetworkClient networkClient
        {
            get { return container.Resolve<INetworkClient>(); }
        }

        public bool Connected
        {
            get
            {
                if (container.CanResolve<INetworkClient>())
                    return networkClient.Connected;
                return false;
            }
        }

        public async Task<bool> ConnectAsync(string host, int port = 15471)
        {
            var result = await networkClient.ConnectAsync(host, port);

            if (result == SocketError.Success)
                return true;
            return false;
        }

        public void Disconnect()
        {
            networkClient.Disconnect();
        }<commit_msg>BasicClient ab jetzt von außen zugreifbar<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using RailNet.Clients.Ecos.Basic;
using RailNet.Clients.Ecos.Network;
using RailNet.Core;
using TinyIoC;

namespace RailNet.Clients.Ecos
{
    public class RailClient : RailNetClientBase
    {
        private readonly TinyIoCContainer container;

        private INetworkClient networkClient
        {
            get { return container.Resolve<INetworkClient>(); }
        }

        public bool Connected
        {
            get
            {
                if (container.CanResolve<INetworkClient>())
                    return networkClient.Connected;
                return false;
            }
        }

        public IBasicClient BasicClient {get { return container.Resolve<IBasicClient>(); }}

        public async Task<bool> ConnectAsync(string host, int port = 15471)
        {
            var result = await networkClient.ConnectAsync(host, port);

            if (result == SocketError.Success)
                return true;
            return false;
        }

        public void Disconnect()
        {
            networkClient.Disconnect();
        }
{'fraction_non_alphanumeric': 0.07701863354037267, 'fraction_numerical': 0.004140786749482402, 'mean_word_length': 1.99009900990099, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '3615419', 'n_tokens_mistral': 646, 'n_tokens_neox': 623, 'n_words': 151}