- Posts: 29
- Joined: Thu Apr 21, 2016 3:28 pm
So, I've been trying to get a TCP/IP client connection to our Hyperdeck Pro working but so far I have not been able to get it to work. It's funny because I was able to get a TCP connection to our VideoHub 20x20 working with no problem with this code but the same code does not work with the Hyperdeck. When I run it nothing happens. Any ideas anyone? Code below:
- Code: Select all
...
...
...
using System.Net.Sockets;
private void button29_Click(object sender, EventArgs e)
{
hyperdeck_cmd("play");
}
private void hyperdeck_cmd(string cmdtxt)
{
// TCP connection vars...
private TcpClient hdeckClient;
string hdeckserver = "10.x.x.x";
int hdeckPort = 9993;
//New client object...
hdeckClient = new TcpClient();
hdeckClient.Connect(hdeckserver, hdeckPort);
//...append carriage return and newline
cmdtxt = cmdtxt + "\r\n";
//...send stream
int bytecount = System.Text.Encoding.ASCII.GetByteCount(cmdtxt);
byte[] sendData = new byte[bytecount];
sendData = System.Text.Encoding.ASCII.GetBytes(cmdtxt);
NetworkStream stream = hdeckClient.GetStream();
stream.Write(sendData, 0, sendData.Length);
//...cleanup
stream.Close();
hdeckClient.Close();
}