You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Avoid calling close when polling a UDP peer without socket
This commit is contained in:
@@ -157,6 +157,10 @@ Error PacketPeerUDPPosix::wait() {
|
||||
|
||||
Error PacketPeerUDPPosix::_poll(bool p_wait) {
|
||||
|
||||
if (sockfd==-1) {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
struct sockaddr_storage from = {0};
|
||||
socklen_t len = sizeof(struct sockaddr_storage);
|
||||
int ret;
|
||||
|
||||
@@ -152,6 +152,9 @@ Error PacketPeerUDPWinsock::wait() {
|
||||
}
|
||||
Error PacketPeerUDPWinsock::_poll(bool p_wait) {
|
||||
|
||||
if (sockfd==-1) {
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
_set_blocking(p_wait);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user