File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ void WSLPeer::Resolver::try_next_candidate(Ref<StreamPeerTCP> &p_tcp) {
9999 p_tcp->poll ();
100100 StreamPeerTCP::Status status = p_tcp->get_status ();
101101 if (status == StreamPeerTCP::STATUS_CONNECTED) {
102+ // On Windows, setting TCP_NODELAY may fail if the socket is still connecting.
103+ p_tcp->set_no_delay (true );
102104 ip_candidates.clear ();
103105 return ;
104106 } else if (status == StreamPeerTCP::STATUS_CONNECTING) {
@@ -112,7 +114,6 @@ void WSLPeer::Resolver::try_next_candidate(Ref<StreamPeerTCP> &p_tcp) {
112114 while (ip_candidates.size ()) {
113115 Error err = p_tcp->connect_to_host (ip_candidates.pop_front (), port);
114116 if (err == OK) {
115- p_tcp->set_no_delay (true );
116117 return ;
117118 } else {
118119 p_tcp->disconnect_from_host ();
@@ -311,7 +312,7 @@ void WSLPeer::_do_client_handshake() {
311312 ERR_FAIL_COND (tcp.is_null ());
312313
313314 // Try to connect to candidates.
314- if (resolver.has_more_candidates ()) {
315+ if (resolver.has_more_candidates () || tcp-> get_status () == StreamPeerTCP::STATUS_CONNECTING ) {
315316 resolver.try_next_candidate (tcp);
316317 if (resolver.has_more_candidates ()) {
317318 return ; // Still pending.
You can’t perform that action at this time.
0 commit comments