Create test pixelhub client for debugging purposes

This commit is contained in:
Starbeamrainbowlabs 2016-11-17 19:19:09 +00:00
parent 7a3eaf2847
commit 9e19127699
4 changed files with 114 additions and 0 deletions

View File

@ -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>

View File

@ -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());
}
}
}

View File

@ -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();
}
}
}

View File

@ -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("")]