I have client-server application. The server is in C.
Server have this structure:
int main (... ) {
FILE * fp;
fp = fopen("serverLog.log","w");
//init variables
//bind server
//listen server on port
while(1) {
//some code
//accept
//some code
int check = pthread_create(&thread, NULL, handle_client,&ctx);
}
fclose(fp);
return EXIT_SUCCSESS;
}
I run the server, and close the server using CTRL+C. What happens with filedescriptor fd? I suppose, that it stays open. If yes, what can I do with that? Thx