mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-22 03:05:16 +00:00
Hopefully prevent close socket race condition
This commit is contained in:
parent
28c7f92453
commit
24e724a824
1 changed files with 8 additions and 7 deletions
|
@ -72,12 +72,13 @@ s32 SocketBase::getFd() {
|
|||
|
||||
bool SocketBase::closeSocket() {
|
||||
|
||||
this->socket_log_state = SOCKET_LOG_DISCONNECTED; // probably not safe to assume socket will be closed
|
||||
if (this->socket_log_state != SOCKET_LOG_DISCONNECTED) {
|
||||
nn::Result result = nn::socket::Close(this->socket_log_socket);
|
||||
if (result.isSuccess()) {
|
||||
this->socket_log_state = SOCKET_LOG_DISCONNECTED;
|
||||
}
|
||||
return result.isSuccess();
|
||||
}
|
||||
|
||||
nn::Result result = nn::socket::Close(this->socket_log_socket);
|
||||
|
||||
return result.isSuccess();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue