Basic workspace connection and Cue Lists fetching working

This commit is contained in:
Joel Wetzell
2020-06-09 19:03:33 -05:00
parent 830e905300
commit 130366acad
14 changed files with 1716 additions and 147 deletions
+24 -6
View File
@@ -46,12 +46,22 @@ namespace SharpOSC
_address = address;
}
public void Connect()
public bool Connect()
{
client = new TcpClient(Address, Port);
Console.WriteLine($"TCPClient - connect called for <{Address}:{Port}>");
Thread receivingThread = new Thread(ReceiveLoop);
receivingThread.Start();
try
{
client = new TcpClient(Address, Port);
Thread receivingThread = new Thread(ReceiveLoop);
receivingThread.Start();
//Console.WriteLine($"TCPClient - connected to <{Address}:{Port}>");
return true;
}
catch (Exception e)
{
//Console.WriteLine(e.Message);
return false;
}
}
public void Send(byte[] message)
@@ -67,6 +77,14 @@ namespace SharpOSC
Send(data);
}
public bool IsConnected
{
get
{
return client.Connected;
}
}
public void ReceiveLoop()
{
while (client.Connected)
@@ -109,7 +127,7 @@ namespace SharpOSC
}
} catch(Exception e)
{
//Log.Debug("TCPSENDER - Receive Exception: " + e.ToString());
//Console.WriteLine("TCPSENDER - Receive Exception: " + e.ToString());
}
}