Skip to content

Commit a8f573b

Browse files
committed
Socket List Mutex fixed
1 parent 462986c commit a8f573b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/server.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,10 @@ int main(void)
267267

268268
/* Cerramos las conexiones pendientes. */
269269
while(vSockets.size() != 0){
270-
shutdown(vSockets[vSockets.size() - 1], 2);
271-
vSockets.pop_back();
270+
socketListMutex.lock();
271+
shutdown(vSockets[vSockets.size() - 1], 2);
272+
vSockets.pop_back();
273+
socketListMutex.unlock();
272274
}
273275

274276
/* Cerramos la conexión que escucha. */

0 commit comments

Comments
 (0)