mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge commit godotengine/godot@5abed52fd9
This commit is contained in:
@@ -46,8 +46,10 @@ bool RemoteDebuggerPeerTCP::has_message() {
|
||||
|
||||
Array RemoteDebuggerPeerTCP::get_message() {
|
||||
MutexLock lock(mutex);
|
||||
ERR_FAIL_COND_V(!has_message(), Array());
|
||||
Array out = in_queue.front()->get();
|
||||
List<Array>::Element *E = in_queue.front();
|
||||
ERR_FAIL_NULL_V_MSG(E, Array(), "No remote debugger messages in queue.");
|
||||
|
||||
Array out = E->get();
|
||||
in_queue.pop_front();
|
||||
return out;
|
||||
}
|
||||
@@ -98,11 +100,13 @@ void RemoteDebuggerPeerTCP::_write_out() {
|
||||
while (tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED && tcp_client->wait(NetSocket::POLL_TYPE_OUT) == OK) {
|
||||
uint8_t *buf = out_buf.ptrw();
|
||||
if (out_left <= 0) {
|
||||
if (out_queue.is_empty()) {
|
||||
break; // Nothing left to send
|
||||
}
|
||||
mutex.lock();
|
||||
Variant var = out_queue.front()->get();
|
||||
List<Array>::Element *E = out_queue.front();
|
||||
if (!E) {
|
||||
mutex.unlock();
|
||||
break;
|
||||
}
|
||||
Variant var = E->get();
|
||||
out_queue.pop_front();
|
||||
mutex.unlock();
|
||||
int size = 0;
|
||||
@@ -165,7 +169,8 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po
|
||||
const int tries = 6;
|
||||
const int waits[tries] = { 1, 10, 100, 1000, 1000, 1000 };
|
||||
|
||||
tcp_client->connect_to_host(ip, port);
|
||||
Error err = tcp_client->connect_to_host(ip, port);
|
||||
ERR_FAIL_COND_V_MSG(err != OK, err, vformat("Remote Debugger: Unable to connect to host '%s:%d'.", p_host, port));
|
||||
|
||||
for (int i = 0; i < tries; i++) {
|
||||
tcp_client->poll();
|
||||
|
||||
Reference in New Issue
Block a user