mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-11-26 07:46:54 +00:00
Fix connection not terminating on server exit for Linux native builds (#277)
Debug line from another PR fixed an issue, where exiting the server would not terminate the connection properly. Additionally, the other PR had been missing curly braces for an if-check -- has been added here. These changes fix the connection termination and don't come with side effects such as no ping and player movement. --- By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion. I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.
This commit is contained in:
1 file changed
+3
-1
@@ -76,8 +76,10 @@ void UDPRcv() {
|
||||
#endif
|
||||
ZeroMemory(&FromServer, clientLength);
|
||||
static thread_local std::array<char, 10240> Ret {};
|
||||
if (UDPSock == -1)
|
||||
if (UDPSock == -1) {
|
||||
debug("UDPSock == -1");
|
||||
return;
|
||||
}
|
||||
int32_t Rcv = recvfrom(UDPSock, Ret.data(), Ret.size() - 1, 0, (sockaddr*)&FromServer, &clientLength);
|
||||
if (Rcv == SOCKET_ERROR)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user