commit 36c0667f49c5736a52d332bd8fe76e3073da3eb6
Author: Eliška Mourycová <eliska.mourycova@seznam.cz>
Date:   Wed Apr 14 14:27:28 2021 +0200

    Re #8619. Simple server and client capable of sending and receiving data.

diff --git a/ClientConnectionTest/ClientTest/.vs/ClientTest/DesignTimeBuild/.dtbcache.v2 b/ClientConnectionTest/ClientTest/.vs/ClientTest/DesignTimeBuild/.dtbcache.v2
new file mode 100644
index 0000000..e926fe6
Binary files /dev/null and b/ClientConnectionTest/ClientTest/.vs/ClientTest/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/ClientConnectionTest/ClientTest/.vs/ClientTest/v16/.suo b/ClientConnectionTest/ClientTest/.vs/ClientTest/v16/.suo
new file mode 100644
index 0000000..063d377
Binary files /dev/null and b/ClientConnectionTest/ClientTest/.vs/ClientTest/v16/.suo differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest.sln b/ClientConnectionTest/ClientTest/ClientTest.sln
new file mode 100644
index 0000000..338b09c
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest.sln
@@ -0,0 +1,25 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31129.286
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientTest", "ClientTest\ClientTest.csproj", "{E064409E-C390-460F-B41E-4E6E71C04CA0}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{E064409E-C390-460F-B41E-4E6E71C04CA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E064409E-C390-460F-B41E-4E6E71C04CA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E064409E-C390-460F-B41E-4E6E71C04CA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E064409E-C390-460F-B41E-4E6E71C04CA0}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {7DDA7CFA-9AE1-4546-B764-AEC0161AFD6F}
+	EndGlobalSection
+EndGlobal
diff --git a/ClientConnectionTest/ClientTest/ClientTest/ClientTest.csproj b/ClientConnectionTest/ClientTest/ClientTest/ClientTest.csproj
new file mode 100644
index 0000000..2082704
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/ClientTest.csproj
@@ -0,0 +1,8 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net5.0</TargetFramework>
+  </PropertyGroup>
+
+</Project>
diff --git a/ClientConnectionTest/ClientTest/ClientTest/Program.cs b/ClientConnectionTest/ClientTest/ClientTest/Program.cs
new file mode 100644
index 0000000..8d2627a
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/Program.cs
@@ -0,0 +1,242 @@
+﻿//// Asynchronous Client Socket Example
+//// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx
+
+//using System;
+//using System.Net;
+//using System.Net.Sockets;
+//using System.Threading;
+//using System.Text;
+
+//// State object for receiving data from remote device.
+//public class StateObject
+//{
+//    // Client socket.
+//    public Socket workSocket = null;
+//    // Size of receive buffer.
+//    public const int BufferSize = 256;
+//    // Receive buffer.
+//    public byte[] buffer = new byte[BufferSize];
+//    // Received data string.
+//    public StringBuilder sb = new StringBuilder();
+//}
+
+//public class AsynchronousClient
+//{
+//    // The port number for the remote device.
+//    private const int port = 11000;
+
+//    // ManualResetEvent instances signal completion.
+//    private static ManualResetEvent connectDone =
+//        new ManualResetEvent(false);
+//    private static ManualResetEvent sendDone =
+//        new ManualResetEvent(false);
+//    private static ManualResetEvent receiveDone =
+//        new ManualResetEvent(false);
+
+//    // The response from the remote device.
+//    private static String response = String.Empty;
+
+//    private static void StartClient()
+//    {
+//        // Connect to a remote device.
+//        try
+//        {
+//            // Establish the remote endpoint for the socket.
+//            // The name of the 
+//            // remote device is "host.contoso.com".
+//            IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost");
+//            IPAddress ipAddress = ipHostInfo.AddressList[0];
+//            IPEndPoint remoteEP = new IPEndPoint(IPAddress.Loopback, port);
+
+//            // Create a TCP/IP socket.
+//            Socket client = new Socket(AddressFamily.InterNetwork,
+//                SocketType.Stream, ProtocolType.Tcp);
+
+//            // Connect to the remote endpoint.
+//            client.BeginConnect(remoteEP,
+//                new AsyncCallback(ConnectCallback), client);
+//            connectDone.WaitOne();
+
+//            // Send test data to the remote device.
+//            Send(client, "This is a test!");
+//            sendDone.WaitOne();
+
+//            // Receive the response from the remote device.
+//            Receive(client);
+//            receiveDone.WaitOne();
+
+//            // Write the response to the console.
+//            Console.WriteLine("Response received : {0}", response);
+
+//            // Release the socket.
+//            client.Shutdown(SocketShutdown.Both);
+//            client.Close();
+
+//        }
+//        catch (Exception e)
+//        {
+//            Console.WriteLine(e.ToString());
+//        }
+//    }
+
+//    private static void ConnectCallback(IAsyncResult ar)
+//    {
+//        try
+//        {
+//            // Retrieve the socket from the state object.
+//            Socket client = (Socket)ar.AsyncState;
+
+//            // Complete the connection.
+//            client.EndConnect(ar);
+
+//            Console.WriteLine("Socket connected to {0}",
+//                client.RemoteEndPoint.ToString());
+
+//            // Signal that the connection has been made.
+//            connectDone.Set();
+//        }
+//        catch (Exception e)
+//        {
+//            Console.WriteLine(e.ToString());
+//        }
+//    }
+
+//    private static void Receive(Socket client)
+//    {
+//        try
+//        {
+//            // Create the state object.
+//            StateObject state = new StateObject();
+//            state.workSocket = client;
+
+//            // Begin receiving the data from the remote device.
+//            client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
+//                new AsyncCallback(ReceiveCallback), state);
+//        }
+//        catch (Exception e)
+//        {
+//            Console.WriteLine(e.ToString());
+//        }
+//    }
+
+//    private static void ReceiveCallback(IAsyncResult ar)
+//    {
+//        try
+//        {
+//            // Retrieve the state object and the client socket 
+//            // from the asynchronous state object.
+//            StateObject state = (StateObject)ar.AsyncState;
+//            Socket client = state.workSocket;
+
+//            // Read data from the remote device.
+//            int bytesRead = client.EndReceive(ar);
+
+//            if (bytesRead > 0)
+//            {
+//                // There might be more data, so store the data received so far.
+//                state.sb.Append(Encoding.ASCII.GetString(state.buffer, 0, bytesRead));
+
+//                // Get the rest of the data.
+//                client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,
+//                    new AsyncCallback(ReceiveCallback), state);
+//            }
+//            else
+//            {
+//                // All the data has arrived; put it in response.
+//                if (state.sb.Length > 1)
+//                {
+//                    response = state.sb.ToString();
+//                }
+//                // Signal that all bytes have been received.
+//                receiveDone.Set();
+//            }
+//        }
+//        catch (Exception e)
+//        {
+//            Console.WriteLine(e.ToString());
+//        }
+//    }
+
+//    private static void Send(Socket client, String data)
+//    {
+//        // Convert the string data to byte data using ASCII encoding.
+//        byte[] byteData = Encoding.ASCII.GetBytes(data);
+
+//        // Begin sending the data to the remote device.
+//        client.BeginSend(byteData, 0, byteData.Length, 0,
+//            new AsyncCallback(SendCallback), client);
+//    }
+
+//    private static void SendCallback(IAsyncResult ar)
+//    {
+//        try
+//        {
+//            // Retrieve the socket from the state object.
+//            Socket client = (Socket)ar.AsyncState;
+
+//            // Complete sending the data to the remote device.
+//            int bytesSent = client.EndSend(ar);
+//            Console.WriteLine("Sent {0} bytes to server.", bytesSent);
+
+//            // Signal that all bytes have been sent.
+//            sendDone.Set();
+//        }
+//        catch (Exception e)
+//        {
+//            Console.WriteLine(e.ToString());
+//        }
+//    }
+
+//    public static void Main(String[] args)
+//    {
+//        StartClient();
+//        Console.ReadLine();
+//    }
+//}
+
+
+
+
+using System;
+using System.Net.Sockets;
+using System.Text;
+
+class Program
+{
+    const int PORT_NO = 11000;
+    const string SERVER_IP = "127.0.0.1";
+    static void Main(string[] args)
+    {
+        //---data to send to the server---
+        string textToSend = "ahoj!";
+
+        //---create a TCPClient object at the IP and port no.---
+        TcpClient client = new TcpClient(SERVER_IP, PORT_NO);
+        NetworkStream nwStream = client.GetStream();
+
+
+		while (true)
+		{
+            Console.WriteLine("enter text: ");
+            textToSend = Console.ReadLine();
+
+
+            byte[] bytesToSend = ASCIIEncoding.ASCII.GetBytes(textToSend);
+
+            //---send the text---
+            Console.WriteLine("Sending : " + textToSend);
+            nwStream.Write(bytesToSend, 0, bytesToSend.Length);
+			if (textToSend.Equals("bye!"))
+			{
+                break;
+			}
+
+            //---read back the text---
+            byte[] bytesToRead = new byte[client.ReceiveBufferSize];
+            int bytesRead = nwStream.Read(bytesToRead, 0, client.ReceiveBufferSize);
+            Console.WriteLine("Received : " + Encoding.ASCII.GetString(bytesToRead, 0, bytesRead));
+        }
+        
+        client.Close();
+    }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.deps.json b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.deps.json
new file mode 100644
index 0000000..341a453
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.deps.json
@@ -0,0 +1,23 @@
+{
+  "runtimeTarget": {
+    "name": ".NETCoreApp,Version=v5.0",
+    "signature": ""
+  },
+  "compilationOptions": {},
+  "targets": {
+    ".NETCoreApp,Version=v5.0": {
+      "ClientTest/1.0.0": {
+        "runtime": {
+          "ClientTest.dll": {}
+        }
+      }
+    }
+  },
+  "libraries": {
+    "ClientTest/1.0.0": {
+      "type": "project",
+      "serviceable": false,
+      "sha512": ""
+    }
+  }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.dll b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.dll
new file mode 100644
index 0000000..d710165
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.dll differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.exe b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.exe
new file mode 100644
index 0000000..4175240
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.exe differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.pdb b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.pdb
new file mode 100644
index 0000000..93c672a
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.pdb differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.dev.json b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.dev.json
new file mode 100644
index 0000000..6e4e6a7
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.dev.json
@@ -0,0 +1,10 @@
+{
+  "runtimeOptions": {
+    "additionalProbingPaths": [
+      "C:\\Users\\elisk\\.dotnet\\store\\|arch|\\|tfm|",
+      "C:\\Users\\elisk\\.nuget\\packages",
+      "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
+      "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
+    ]
+  }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.json b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.json
new file mode 100644
index 0000000..a8e7e82
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ClientTest.runtimeconfig.json
@@ -0,0 +1,9 @@
+{
+  "runtimeOptions": {
+    "tfm": "net5.0",
+    "framework": {
+      "name": "Microsoft.NETCore.App",
+      "version": "5.0.0"
+    }
+  }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ref/ClientTest.dll b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ref/ClientTest.dll
new file mode 100644
index 0000000..5773529
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/bin/Debug/net5.0/ref/ClientTest.dll differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.dgspec.json b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.dgspec.json
new file mode 100644
index 0000000..3d50cdb
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.dgspec.json
@@ -0,0 +1,67 @@
+{
+  "format": 1,
+  "restore": {
+    "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj": {}
+  },
+  "projects": {
+    "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj": {
+      "version": "1.0.0",
+      "restore": {
+        "projectUniqueName": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj",
+        "projectName": "ClientTest",
+        "projectPath": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj",
+        "packagesPath": "C:\\Users\\elisk\\.nuget\\packages\\",
+        "outputPath": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\obj\\",
+        "projectStyle": "PackageReference",
+        "fallbackFolders": [
+          "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
+          "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
+        ],
+        "configFilePaths": [
+          "C:\\Users\\elisk\\AppData\\Roaming\\NuGet\\NuGet.Config",
+          "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
+          "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
+        ],
+        "originalTargetFrameworks": [
+          "net5.0"
+        ],
+        "sources": {
+          "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
+          "https://api.nuget.org/v3/index.json": {}
+        },
+        "frameworks": {
+          "net5.0": {
+            "targetAlias": "net5.0",
+            "projectReferences": {}
+          }
+        },
+        "warningProperties": {
+          "warnAsError": [
+            "NU1605"
+          ]
+        }
+      },
+      "frameworks": {
+        "net5.0": {
+          "targetAlias": "net5.0",
+          "imports": [
+            "net461",
+            "net462",
+            "net47",
+            "net471",
+            "net472",
+            "net48"
+          ],
+          "assetTargetFallback": true,
+          "warn": true,
+          "frameworkReferences": {
+            "Microsoft.NETCore.App": {
+              "privateAssets": "all"
+            }
+          },
+          "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.props b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.props
new file mode 100644
index 0000000..7a0e115
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.props
@@ -0,0 +1,20 @@
+﻿<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+    <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
+    <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
+    <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
+    <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
+    <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\elisk\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
+    <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
+    <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.9.1</NuGetToolVersion>
+  </PropertyGroup>
+  <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
+    <SourceRoot Include="C:\Users\elisk\.nuget\packages\" />
+    <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
+    <SourceRoot Include="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\" />
+  </ItemGroup>
+  <PropertyGroup>
+    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.targets b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.targets
new file mode 100644
index 0000000..53cfaa1
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/ClientTest.csproj.nuget.g.targets
@@ -0,0 +1,6 @@
+﻿<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs
new file mode 100644
index 0000000..2f7e5ec
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs
@@ -0,0 +1,4 @@
+// <autogenerated />
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfo.cs b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfo.cs
new file mode 100644
index 0000000..206ce7b
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfo.cs
@@ -0,0 +1,23 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System;
+using System.Reflection;
+
+[assembly: System.Reflection.AssemblyCompanyAttribute("ClientTest")]
+[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
+[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
+[assembly: System.Reflection.AssemblyProductAttribute("ClientTest")]
+[assembly: System.Reflection.AssemblyTitleAttribute("ClientTest")]
+[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
+
+// Generated by the MSBuild WriteCodeFragment class.
+
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfoInputs.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfoInputs.cache
new file mode 100644
index 0000000..1521441
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.AssemblyInfoInputs.cache
@@ -0,0 +1 @@
+eb314383aa25a94ffe0d94c4615ffa341f193693
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.GeneratedMSBuildEditorConfig.editorconfig b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.GeneratedMSBuildEditorConfig.editorconfig
new file mode 100644
index 0000000..d7e2983
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.GeneratedMSBuildEditorConfig.editorconfig
@@ -0,0 +1,8 @@
+is_global = true
+build_property.TargetFramework = net5.0
+build_property.TargetPlatformMinVersion = 
+build_property.UsingMicrosoftNETSdkWeb = 
+build_property.ProjectTypeGuids = 
+build_property.PublishSingleFile = 
+build_property.IncludeAllContentForSelfExtract = 
+build_property._SupportedPlatformList = Android,iOS,Linux,macOS,Windows
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.assets.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.assets.cache
new file mode 100644
index 0000000..9d88358
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.assets.cache differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.CoreCompileInputs.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000..f10f55a
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+2286e48d888f91425603880718dc137e6a6fa787
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.FileListAbsolute.txt b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..dea3d6e
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csproj.FileListAbsolute.txt
@@ -0,0 +1,16 @@
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.exe
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.deps.json
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.runtimeconfig.json
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.runtimeconfig.dev.json
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.dll
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ref\ClientTest.dll
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\bin\Debug\net5.0\ClientTest.pdb
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.csprojAssemblyReference.cache
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.GeneratedMSBuildEditorConfig.editorconfig
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.AssemblyInfoInputs.cache
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.AssemblyInfo.cs
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.csproj.CoreCompileInputs.cache
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.dll
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ref\ClientTest.dll
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.pdb
+C:\Users\elisk\Documents\aswi2021tri-musketyri\ClientConnectionTest\ClientTest\ClientTest\obj\Debug\net5.0\ClientTest.genruntimeconfig.cache
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csprojAssemblyReference.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csprojAssemblyReference.cache
new file mode 100644
index 0000000..9ffa8f8
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.csprojAssemblyReference.cache differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.dll b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.dll
new file mode 100644
index 0000000..d710165
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.dll differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.genruntimeconfig.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.genruntimeconfig.cache
new file mode 100644
index 0000000..f61f7d7
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.genruntimeconfig.cache
@@ -0,0 +1 @@
+5e75078f26ed939765668146ee34e762d1fe23a6
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.pdb b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.pdb
new file mode 100644
index 0000000..93c672a
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ClientTest.pdb differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/apphost.exe b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/apphost.exe
new file mode 100644
index 0000000..4175240
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/apphost.exe differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ref/ClientTest.dll b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ref/ClientTest.dll
new file mode 100644
index 0000000..5773529
Binary files /dev/null and b/ClientConnectionTest/ClientTest/ClientTest/obj/Debug/net5.0/ref/ClientTest.dll differ
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/project.assets.json b/ClientConnectionTest/ClientTest/ClientTest/obj/project.assets.json
new file mode 100644
index 0000000..8cc21c0
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/project.assets.json
@@ -0,0 +1,74 @@
+{
+  "version": 3,
+  "targets": {
+    "net5.0": {}
+  },
+  "libraries": {},
+  "projectFileDependencyGroups": {
+    "net5.0": []
+  },
+  "packageFolders": {
+    "C:\\Users\\elisk\\.nuget\\packages\\": {},
+    "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {},
+    "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
+  },
+  "project": {
+    "version": "1.0.0",
+    "restore": {
+      "projectUniqueName": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj",
+      "projectName": "ClientTest",
+      "projectPath": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj",
+      "packagesPath": "C:\\Users\\elisk\\.nuget\\packages\\",
+      "outputPath": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\obj\\",
+      "projectStyle": "PackageReference",
+      "fallbackFolders": [
+        "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
+        "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
+      ],
+      "configFilePaths": [
+        "C:\\Users\\elisk\\AppData\\Roaming\\NuGet\\NuGet.Config",
+        "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
+        "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
+      ],
+      "originalTargetFrameworks": [
+        "net5.0"
+      ],
+      "sources": {
+        "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
+        "https://api.nuget.org/v3/index.json": {}
+      },
+      "frameworks": {
+        "net5.0": {
+          "targetAlias": "net5.0",
+          "projectReferences": {}
+        }
+      },
+      "warningProperties": {
+        "warnAsError": [
+          "NU1605"
+        ]
+      }
+    },
+    "frameworks": {
+      "net5.0": {
+        "targetAlias": "net5.0",
+        "imports": [
+          "net461",
+          "net462",
+          "net47",
+          "net471",
+          "net472",
+          "net48"
+        ],
+        "assetTargetFallback": true,
+        "warn": true,
+        "frameworkReferences": {
+          "Microsoft.NETCore.App": {
+            "privateAssets": "all"
+          }
+        },
+        "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.201\\RuntimeIdentifierGraph.json"
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/ClientConnectionTest/ClientTest/ClientTest/obj/project.nuget.cache b/ClientConnectionTest/ClientTest/ClientTest/obj/project.nuget.cache
new file mode 100644
index 0000000..a2a7340
--- /dev/null
+++ b/ClientConnectionTest/ClientTest/ClientTest/obj/project.nuget.cache
@@ -0,0 +1,8 @@
+{
+  "version": 2,
+  "dgSpecHash": "lM8jVtEbQrnJer4YM6YnoItJzdeA9YlaM/Bnjv08r2LSYcPiYn5ThXxsCE2lrusSCPVT5jW2DvFhk4P3ZqN5VQ==",
+  "success": true,
+  "projectFilePath": "C:\\Users\\elisk\\Documents\\aswi2021tri-musketyri\\ClientConnectionTest\\ClientTest\\ClientTest\\ClientTest.csproj",
+  "expectedPackageFiles": [],
+  "logs": []
+}
\ No newline at end of file
diff --git a/Server/.vs/ServerApp/v16/.suo b/Server/.vs/ServerApp/v16/.suo
index 1538feb..6b802ff 100644
Binary files a/Server/.vs/ServerApp/v16/.suo and b/Server/.vs/ServerApp/v16/.suo differ
diff --git a/Server/ServerApp/Connection/SocketListener.cs b/Server/ServerApp/Connection/SocketListener.cs
new file mode 100644
index 0000000..7c9ce76
--- /dev/null
+++ b/Server/ServerApp/Connection/SocketListener.cs
@@ -0,0 +1,165 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Connection
+{
+    // State object for reading client data asynchronously
+    public class StateObject
+    {
+        // Client  socket.
+        public Socket workSocket = null;
+        // Size of receive buffer.
+        public const int BufferSize = 1024;
+        // Receive buffer.
+        public byte[] buffer = new byte[BufferSize];
+        // Received data string.
+        public StringBuilder sb = new StringBuilder();
+    }
+
+    public class AsynchronousSocketListener
+    {
+        // Thread signal.
+        public static ManualResetEvent allDone = new ManualResetEvent(false);
+
+        public AsynchronousSocketListener()
+        {
+        }
+
+        public static void StartListening()
+        {
+            // Data buffer for incoming data.
+            byte[] bytes = new Byte[1024];
+
+            // Establish the local endpoint for the socket.
+            // The DNS name of the computer
+            // running the listener is "host.contoso.com".
+            IPHostEntry ipHostInfo = Dns.GetHostEntry(Dns.GetHostName());
+            IPAddress ipAddress = ipHostInfo.AddressList[1];
+            Console.WriteLine("ip: " + ipAddress.ToString());
+            IPEndPoint localEndPoint = new IPEndPoint(/*ipAddress*/IPAddress.Loopback, 11000);
+
+            // Create a TCP/IP socket.
+            Socket listener = new Socket(AddressFamily.InterNetwork,
+                SocketType.Stream, ProtocolType.Tcp);
+
+            // Bind the socket to the local endpoint and listen for incoming connections.
+            try
+            {
+                listener.Bind(localEndPoint);
+                listener.Listen(100);
+
+                while (true)
+                {
+                    // Set the event to nonsignaled state.
+                    allDone.Reset();
+
+                    // Start an asynchronous socket to listen for connections.
+                    Console.WriteLine("Waiting for a connection...");
+                    listener.BeginAccept(new AsyncCallback(AcceptCallback), listener);
+
+                    // Wait until a connection is made before continuing.
+                    allDone.WaitOne();
+                }
+
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.ToString());
+            }
+
+            Console.WriteLine("\nPress ENTER to continue...");
+            Console.Read();
+
+        }
+
+        public static void AcceptCallback(IAsyncResult ar)
+        {
+            // Signal the main thread to continue.
+            allDone.Set();
+
+            // Get the socket that handles the client request.
+            Socket listener = (Socket)ar.AsyncState;
+            Socket handler = listener.EndAccept(ar);
+
+            // Create the state object.
+            StateObject state = new StateObject();
+            state.workSocket = handler;
+            handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state);
+            
+        }
+
+        public static void ReadCallback(IAsyncResult ar)
+        {
+            String content = String.Empty;
+
+            // Retrieve the state object and the handler socket
+            // from the asynchronous state object.
+            StateObject state = (StateObject)ar.AsyncState;
+            Socket handler = state.workSocket;
+
+            // Read data from the client socket. 
+            int bytesRead = handler.EndReceive(ar);
+
+            if (bytesRead > 0)
+            {
+                // There  might be more data, so store the data received so far.
+                state.sb.Append(Encoding.ASCII.GetString(state.buffer, 0, bytesRead));
+
+                // Check for end-of-file tag. If it is not there, read 
+                // more data.
+                content = state.sb.ToString();
+                if (content.IndexOf("!") > -1)
+                {
+                    // All the data has been read from the 
+                    // client. Display it on the console.
+                    Console.WriteLine("Read {0} bytes from socket. \n Data : {1}", content.Length, content);
+                    // Echo the data back to the client.
+                    Send(handler, content);
+
+                    handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state);
+                }
+                else
+                {
+                    // Not all data received. Get more.
+                    handler.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReadCallback), state);
+                }
+            }
+        }
+
+        private static void Send(Socket handler, String data)
+        {
+            // Convert the string data to byte data using ASCII encoding.
+            byte[] byteData = Encoding.ASCII.GetBytes(data);
+
+            // Begin sending the data to the remote device.
+            handler.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), handler);
+        }
+
+        private static void SendCallback(IAsyncResult ar)
+        {
+            try
+            {
+                // Retrieve the socket from the state object.
+                Socket handler = (Socket)ar.AsyncState;
+
+                // Complete sending the data to the remote device.
+                int bytesSent = handler.EndSend(ar);
+                Console.WriteLine("Sent {0} bytes to client.", bytesSent);
+
+                //handler.Shutdown(SocketShutdown.Both);
+                //handler.Close();
+
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.ToString());
+            }
+        }
+    }
+}
diff --git a/Server/ServerApp/Program.cs b/Server/ServerApp/Program.cs
index 4e4cc29..7e23f02 100644
--- a/Server/ServerApp/Program.cs
+++ b/Server/ServerApp/Program.cs
@@ -1,4 +1,5 @@
-﻿using DataDownload;
+﻿using Connection;
+using DataDownload;
 using Parser.Parsers;
 using System;
 using System.Collections.Generic;
@@ -12,25 +13,31 @@ namespace ServerApp
     {
         static void Main(string[] args)
         {
-			// ALEX
-			//CsvParser p = new CsvParser();
+            // ALEX
+            //CsvParser p = new CsvParser();
 
-			//p.Parse();
+            //p.Parse();
 
 
             // test scenario - data download:
-			DataDownloader dd = new DataDownloader();
-            List<string> savedFiles = new List<string>();
-            savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, 2017, 2021, 0, 13));
-            savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, 2017, 2021, 0, 13));
-            savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, 2017, 2021, 0, 13));
-           
+            //DataDownloader dd = new DataDownloader();
+            //         List<string> savedFiles = new List<string>();
+            //         savedFiles.AddRange(dd.DownloadData(DataType.JIS, DataFormat.CSV, 2017, 2021, 0, 13));
+            //         savedFiles.AddRange(dd.DownloadData(DataType.POCASI, DataFormat.CSV, 2017, 2021, 0, 13));
+            //         savedFiles.AddRange(dd.DownloadData(DataType.STROJE, DataFormat.CSV, 2017, 2021, 0, 13));
+
+
+            //         Console.WriteLine("Saved files: ");
+            //         foreach(string s in savedFiles)
+            //{
+            //             Console.WriteLine(s);
+            //}
 
-            Console.WriteLine("Saved files: ");
-            foreach(string s in savedFiles)
-			{
-                Console.WriteLine(s);
-			}
+
+
+            // test - connection:
+            AsynchronousSocketListener.StartListening();
+           
 
             Console.ReadLine();
         }
diff --git a/Server/ServerApp/ServerApp.csproj b/Server/ServerApp/ServerApp.csproj
index b87fd7d..1d30ab8 100644
--- a/Server/ServerApp/ServerApp.csproj
+++ b/Server/ServerApp/ServerApp.csproj
@@ -45,6 +45,7 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Connection\SocketListener.cs" />
     <Compile Include="DataDownload\DataDownloader.cs" />
     <Compile Include="obj\Debug\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs" />
     <Compile Include="Parser\InputData\CsvDataLoader.cs" />
diff --git a/Server/ServerApp/bin/Debug/ServerApp.exe b/Server/ServerApp/bin/Debug/ServerApp.exe
index e4e4f15..76e523e 100644
Binary files a/Server/ServerApp/bin/Debug/ServerApp.exe and b/Server/ServerApp/bin/Debug/ServerApp.exe differ
diff --git a/Server/ServerApp/bin/Debug/ServerApp.pdb b/Server/ServerApp/bin/Debug/ServerApp.pdb
index 5ce513e..98db335 100644
Binary files a/Server/ServerApp/bin/Debug/ServerApp.pdb and b/Server/ServerApp/bin/Debug/ServerApp.pdb differ
diff --git a/Server/ServerApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Server/ServerApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
index d16ae60..4c92173 100644
Binary files a/Server/ServerApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Server/ServerApp/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/Server/ServerApp/obj/Debug/ServerApp.csproj.CoreCompileInputs.cache b/Server/ServerApp/obj/Debug/ServerApp.csproj.CoreCompileInputs.cache
index ef10f27..ff02fc2 100644
--- a/Server/ServerApp/obj/Debug/ServerApp.csproj.CoreCompileInputs.cache
+++ b/Server/ServerApp/obj/Debug/ServerApp.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-79c6161fcb2ca313d4e4eda6c2e35fd7596821b2
+a1102017b4b6a9c99797a9b313c5acc5681caeb3
diff --git a/Server/ServerApp/obj/Debug/ServerApp.csprojAssemblyReference.cache b/Server/ServerApp/obj/Debug/ServerApp.csprojAssemblyReference.cache
index 53fa971..2ed24bb 100644
Binary files a/Server/ServerApp/obj/Debug/ServerApp.csprojAssemblyReference.cache and b/Server/ServerApp/obj/Debug/ServerApp.csprojAssemblyReference.cache differ
diff --git a/Server/ServerApp/obj/Debug/ServerApp.exe b/Server/ServerApp/obj/Debug/ServerApp.exe
index e4e4f15..76e523e 100644
Binary files a/Server/ServerApp/obj/Debug/ServerApp.exe and b/Server/ServerApp/obj/Debug/ServerApp.exe differ
diff --git a/Server/ServerApp/obj/Debug/ServerApp.pdb b/Server/ServerApp/obj/Debug/ServerApp.pdb
index 5ce513e..98db335 100644
Binary files a/Server/ServerApp/obj/Debug/ServerApp.pdb and b/Server/ServerApp/obj/Debug/ServerApp.pdb differ
