moved registering connection to new thread

This commit is contained in:
Václav Šmejkal 2023-02-21 18:59:44 +01:00
parent 924c840e0d
commit c47c9ffece
Signed by: ENGO150
GPG Key ID: F6D6DF86242C5A59
2 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,6 @@ 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

@ -133,6 +133,8 @@ void *why2_communicate_thread(void *arg)
{ {
printf("User connected.\t%d\n", *((int*) arg)); printf("User connected.\t%d\n", *((int*) arg));
why2_register_connection(*((int*) arg)); //TODO: Remove why2_register_connection if unused
const time_t startTime = time(NULL); const time_t startTime = time(NULL);
char *received = NULL; char *received = NULL;