From 9e19127699b8e36c8293420831836ab9ff47cb3e Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Thu, 17 Nov 2016 19:19:09 +0000
Subject: [PATCH] Create test pixelhub client for debugging purposes

---
 .../PixelHub-Client-Test.csproj               | 40 +++++++++++++++++++
 .../PixelHub-Client-Test/PixelHubClient.cs    | 33 +++++++++++++++
 .../PixelHub-Client-Test/Program.cs           | 15 +++++++
 .../Properties/AssemblyInfo.cs                | 26 ++++++++++++
 4 files changed, 114 insertions(+)
 create mode 100644 PixelHub-Client-Test/PixelHub-Client-Test/PixelHub-Client-Test.csproj
 create mode 100644 PixelHub-Client-Test/PixelHub-Client-Test/PixelHubClient.cs
 create mode 100644 PixelHub-Client-Test/PixelHub-Client-Test/Program.cs
 create mode 100644 PixelHub-Client-Test/PixelHub-Client-Test/Properties/AssemblyInfo.cs

diff --git a/PixelHub-Client-Test/PixelHub-Client-Test/PixelHub-Client-Test.csproj b/PixelHub-Client-Test/PixelHub-Client-Test/PixelHub-Client-Test.csproj
new file mode 100644
index 0000000..57df36c
--- /dev/null
+++ b/PixelHub-Client-Test/PixelHub-Client-Test/PixelHub-Client-Test.csproj
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{1D99DDDB-9457-4B8D-83B8-06663554F4C4}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>PixelHubClientTest</RootNamespace>
+    <AssemblyName>PixelHubClientTest</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ExternalConsole>true</ExternalConsole>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ExternalConsole>true</ExternalConsole>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="PixelHubClient.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
diff --git a/PixelHub-Client-Test/PixelHub-Client-Test/PixelHubClient.cs b/PixelHub-Client-Test/PixelHub-Client-Test/PixelHubClient.cs
new file mode 100644
index 0000000..4c053fa
--- /dev/null
+++ b/PixelHub-Client-Test/PixelHub-Client-Test/PixelHubClient.cs
@@ -0,0 +1,33 @@
+﻿using System;
+using System.Net.Sockets;
+using System.Net;
+using System.IO;
+namespace PixelHubClientTest
+{
+	public class PixelHubClient
+	{
+		TcpClient client;
+
+		StreamReader incoming;
+		StreamWriter outgoing;
+
+		public PixelHubClient ()
+		{
+		}
+
+		public void Connect (IPAddress destination, int port)
+		{
+			client = new TcpClient();
+			client.Connect(destination, port);
+
+			incoming = new StreamReader(client.GetStream());
+			outgoing = new StreamWriter(client.GetStream()) { AutoFlush = true };
+		}
+
+		public void Test ()
+		{
+			outgoing.WriteLine("Testing!");
+			Console.WriteLine("> {0}", incoming.ReadLine());
+		}
+	}
+}
diff --git a/PixelHub-Client-Test/PixelHub-Client-Test/Program.cs b/PixelHub-Client-Test/PixelHub-Client-Test/Program.cs
new file mode 100644
index 0000000..e624940
--- /dev/null
+++ b/PixelHub-Client-Test/PixelHub-Client-Test/Program.cs
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Net;
+
+namespace PixelHubClientTest
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			PixelHubClient pixelClient = new PixelHubClient();
+			pixelClient.Connect(IPAddress.Parse("10.42.0.1"), 5050);
+			pixelClient.Test();
+		}
+	}
+}
diff --git a/PixelHub-Client-Test/PixelHub-Client-Test/Properties/AssemblyInfo.cs b/PixelHub-Client-Test/PixelHub-Client-Test/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..a0a5992
--- /dev/null
+++ b/PixelHub-Client-Test/PixelHub-Client-Test/Properties/AssemblyInfo.cs
@@ -0,0 +1,26 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes. 
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("PixelHubClientTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("Starbeamrainbowlabs")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly, 
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
