Add alert if there is a connection error

This commit is contained in:
Leroy Hopson 2020-05-10 20:48:33 +12:00
parent d8156e0d5a
commit cabd5c305b

View file

@ -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)