From cabd5c305b29f0e65579b445b5bb3b478bfd13bf Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sun, 10 May 2020 20:48:33 +1200 Subject: [PATCH] Add alert if there is a connection error --- scenes/demo.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scenes/demo.gd b/scenes/demo.gd index e725925..0d703c5 100644 --- a/scenes/demo.gd +++ b/scenes/demo.gd @@ -51,7 +51,10 @@ func _process(delta): var res = stream_peer.get_data(stream_peer.get_available_bytes()) var error = res[0] var data = res[1] - if error == OK and not data.empty(): + if error != OK: + OS.alert("Something went wrong with the TCP connection to socat.", + "Connection Error!") + elif not data.empty(): emit_signal("data_received", data)