int child, i, fd;
char c;
main()
{………………….
for(;;) {
sockclient=accept(………..); if(child=fork())<0) {
Perror(“Ошибка создания дочернего процесса”);
Exit(1);
}
else if(child==0) {
close(sockMain); /*работа с сокетом клиента*/ Childwork(sockClient); close(sockClient); exit(0);
}
close(sockClient);
}
}





![Fork_Thread pthread_t thrds[NTHRDS]; // Потоки pass = (char *)malloc(35); pthread_mutex_init(&mutexpass, NULL); /* pthread_t thrds[NTHRDS]; // Потоки pass = (char *)malloc(35); pthread_mutex_init(&mutexpass, NULL); /* Инициализация блокировок */ pthread_mutex_init(&mutexfound, NULL);](/img/tmb/2/148611/5170f8d00ff9c74f2958723a071d7023-800x.jpg)