Announcement

Collapse
No announcement yet.

Sending artist commands over a TCP connection that is left open

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sending artist commands over a TCP connection that is left open

    I'm trying to send commands over TCP to the viz engine using this code:

    using (client)
    {
    await client.ConnectAsync(ip, port);

    if (client.Connected)
    {
    NetworkStream stream = client.GetStream();
    stream.WriteTimeout = 1000;

    if (stream.CanWrite)
    {
    byte[] message = Encoding.ASCII.GetBytes(data);
    await stream.WriteAsync(message, 0, message.Length);
    stream.Close();
    }
    }
    }

    I'm sending something like this as the message: "0 SCENE*VELON_SCENES/SCENE*TREE*$object*FUNCTION*ControlObject*in SET ON 412 SET 1"

    However, the data only seems to be pushed through to the engine once the client is closed using client.Close(). Is there a way to make this data get sent to the engine without closing the connection?

  • #2
    Terminate your command string with '\0' character.

    Comment

    Working...
    X