Don't crash when no tcp connection can be created.

This commit is contained in:
Joel Wetzell
2020-06-12 11:13:51 -05:00
parent 5e942420f4
commit 7ef44762a0
5 changed files with 49 additions and 109 deletions
@@ -13,6 +13,7 @@ namespace qController.Communication
public QParser qParser;
string Address;
int Port;
public bool connected;
public QClient(string address, int port)
{
@@ -20,8 +21,7 @@ namespace qController.Communication
Port = port;
qParser = new QParser();
tcpClient = new TCPClient(Address, Port);
tcpClient.Connect();
connected = tcpClient.Connect();
tcpClient.MessageReceived += OnMessageReceived;
}