summaryrefslogtreecommitdiff
path: root/core/io/stream_peer_tcp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/stream_peer_tcp.cpp')
-rw-r--r--core/io/stream_peer_tcp.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index 7d22176250..b9c5896b24 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -248,16 +248,7 @@ void StreamPeerTCP::set_no_delay(bool p_enabled) {
bool StreamPeerTCP::is_connected_to_host() const {
- if (status == STATUS_NONE || status == STATUS_ERROR) {
-
- return false;
- }
-
- if (status == STATUS_CONNECTED) {
- return true;
- }
-
- return _sock.is_valid() && _sock->is_open();
+ return _sock.is_valid() && _sock->is_open() && (status == STATUS_CONNECTED || status == STATUS_CONNECTING);
}
StreamPeerTCP::Status StreamPeerTCP::get_status() {