implemented linked list in chat-server

This commit is contained in:
Václav Šmejkal 2023-02-21 12:41:35 +01:00
parent 3b85c5fc5a
commit ad9f4b8f2d
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59
2 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,7 @@ int main(void)
if (accepted == -1) continue; if (accepted == -1) continue;
pthread_create(&thread, NULL, why2_communicate_thread, &accepted); pthread_create(&thread, NULL, why2_communicate_thread, &accepted);
why2_register_connection(accepted); //PUSH TO LIST
} }
return 0; return 0;

View File

@ -152,6 +152,7 @@ void *why2_communicate_thread(void *arg)
printf("User exited.\t%d\n", *((int*) arg)); printf("User exited.\t%d\n", *((int*) arg));
//DEALLOCATION //DEALLOCATION
remove_node(get_node(why2_communicate_thread));
close(*((int*) arg)); close(*((int*) arg));
why2_deallocate(received); why2_deallocate(received);