This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
PixelHub/PixelHub-Client-Test/PixelHub-Client-Test/PixelHubClient.cs

34 lines
629 B
C#

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