|
@@ -42,6 +42,11 @@ void* client_thread(void* data) {
|
|
//Recup la valeur de data
|
|
//Recup la valeur de data
|
|
tmp = (int*) data;
|
|
tmp = (int*) data;
|
|
cliId = *tmp;
|
|
cliId = *tmp;
|
|
|
|
+ //Detache le thread
|
|
|
|
+ if (pthread_detach(pthread_self()) != 0) {
|
|
|
|
+ adderror("Impossible de détacher le thread Client");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
//Recup le client
|
|
//Recup le client
|
|
cli = get_client(cliId);
|
|
cli = get_client(cliId);
|
|
if (cli == NULL) {
|
|
if (cli == NULL) {
|
|
@@ -85,6 +90,7 @@ void* udp_thread(void* data) {
|
|
s = (Server) data;
|
|
s = (Server) data;
|
|
//Detache le thread
|
|
//Detache le thread
|
|
if (pthread_detach(pthread_self()) != 0) {
|
|
if (pthread_detach(pthread_self()) != 0) {
|
|
|
|
+ adderror("Impossible de détacher le thread UDP");
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
//Boucle attente
|
|
//Boucle attente
|
|
@@ -118,6 +124,7 @@ void* tcp_thread(void* data) {
|
|
s = (Server*) data;
|
|
s = (Server*) data;
|
|
//Detache le thread
|
|
//Detache le thread
|
|
if (pthread_detach(pthread_self()) != 0) {
|
|
if (pthread_detach(pthread_self()) != 0) {
|
|
|
|
+ adderror("Impossible de détacher le thread TCP");
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
//Boucle attente
|
|
//Boucle attente
|
|
@@ -131,7 +138,7 @@ void* tcp_thread(void* data) {
|
|
//Creation d'un client et de son thread
|
|
//Creation d'un client et de son thread
|
|
cliId = add_client(s[0], s[1]);
|
|
cliId = add_client(s[0], s[1]);
|
|
if (pthread_create(&client, NULL, client_thread, &cliId) != 0) {
|
|
if (pthread_create(&client, NULL, client_thread, &cliId) != 0) {
|
|
- adderror("Impossible de créer le thread CLient");
|
|
|
|
|
|
+ adderror("Impossible de créer le thread Client");
|
|
/*ToDo Avertir Client du probleme*/
|
|
/*ToDo Avertir Client du probleme*/
|
|
}
|
|
}
|
|
}
|
|
}
|