Performance Boost

MinigamesClient.currentInstance.Close();
Correctly Ends all streams from the mini game
This commit is contained in:
brausjonas
2023-04-15 15:42:26 +02:00
parent 9938247ff4
commit 93d8ada602
5 changed files with 176 additions and 107 deletions
@@ -13,9 +13,13 @@ public class MinigamesClient : MonoBehaviour
private Stream stream;
private Queue<Job> jobs = new Queue<Job>();
public static MinigamesClient currentInstance;
private void Start()
{
currentInstance = this;
client = new TcpClient("185.245.96.48", 8051);
stream = client.GetStream();
@@ -55,4 +59,10 @@ public class MinigamesClient : MonoBehaviour
jobs.Enqueue(new Job(read));
}
}
public void Close()
{
stream.Close();
client.Close();
}
}