Skip to content

Commit

Permalink
feat: handle empty packets in UDPServer to prevent processing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLaplace committed Nov 23, 2024
1 parent c2a7766 commit aecd893
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Flakkari/Server/UDPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ bool UDPServer::handleInput(int fd)
void UDPServer::handlePacket()
{
auto packet = _socket->receiveFrom();
if (!packet.has_value())
return;
auto resultAddClient = ClientManager::GetInstance().addClient(packet->first, packet->second);
ClientManager::UnlockInstance();
if (!resultAddClient.has_value())
Expand Down

0 comments on commit aecd893

Please sign in to comment.