Processes in linux (fork ())

0

I am creating a client / server type server using tcp sockets , a client connects to the server, closes the client application, / strong>, but the process on the server that opened that port is still connected to that port, even after the close.

How can I close this door without killing the process?

Obs: I tried to create a child process and from there close the port using fuser -k porta/tcp , but with this command it kills any process that is connected to the port that received kill by fuser , so it kills the parent and child and the program terminates (dead).

If I use thread and I give pthread_exit to the thread that opened the socket connection on that port, the program also terminates (Dead) .

Does anyone have a clue what to do?

    
asked by anonymous 29.06.2018 / 03:07

0 answers