I have a chat server written in c++ and i have a problem with phtreads. This server suppose to handle multiple connections so i created array of pthread. when a new client connects it gives one pthread to this client from the array and it calls handle function where is comunication inplemented. but when this client disconect i dont know how to find which pthread ended and which index to a pthread array is empty. i know this code is horrible but i really want to make this program betterI have a chat server written in c++ and i have