So to accept multiple clients, I am dynamically accepting them, but so that I can handle them(data transfer etc...) I wrote a linked list which so far works fine. I can broadcast a message to all clients fine by looping through my list and SEND->client, fairly standard. But when a client disconnects from the server, the function OnClose is automatically called. When I accept new clients, I set an ID using the SetSockOpt function. So my algo will loop through my list until the ID is found of the closeing socket, so that I can close that connection(required, otherwise server crashes).
void ClientList::CloseCon(int SockID)
{
client *find;
find = head;
for(int i = 0; i < counterVar; i++)
{
if(find->ID == SockID)
{
find->CLIENT.Close();
}
else
{
find = find->link;
}
}
}
My problem, is that it is crashing when I try to create my pointer and set it to the head of the list. CXX0030: Error: expression cannot be evaluated(My head local variable).
So if anyone know's whats up or understands what I am trying to do, please help!