Avoid calling close when polling a UDP peer without socket
This commit is contained in:
parent
8e84e53ebb
commit
e4b9b37ccf
2 changed files with 7 additions and 0 deletions
|
@ -157,6 +157,10 @@ Error PacketPeerUDPPosix::wait() {
|
||||||
|
|
||||||
Error PacketPeerUDPPosix::_poll(bool p_wait) {
|
Error PacketPeerUDPPosix::_poll(bool p_wait) {
|
||||||
|
|
||||||
|
if (sockfd==-1) {
|
||||||
|
return FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
struct sockaddr_storage from = {0};
|
struct sockaddr_storage from = {0};
|
||||||
socklen_t len = sizeof(struct sockaddr_storage);
|
socklen_t len = sizeof(struct sockaddr_storage);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -152,6 +152,9 @@ Error PacketPeerUDPWinsock::wait() {
|
||||||
}
|
}
|
||||||
Error PacketPeerUDPWinsock::_poll(bool p_wait) {
|
Error PacketPeerUDPWinsock::_poll(bool p_wait) {
|
||||||
|
|
||||||
|
if (sockfd==-1) {
|
||||||
|
return FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
_set_blocking(p_wait);
|
_set_blocking(p_wait);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue