mirror of
https://github.com/jwetzell/QControlKit.git
synced 2026-08-09 17:33:53 +00:00
Basic workspace connection and Cue Lists fetching working
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user