Dear all,
I am making a multithreaded server using socket programming in c .. i'd discovered that when the client closes the connection and the server is still sending him a stream of bytes the server crashed with a BROKEN PIPE problem.
I can easily make the client notify the server before closing and solve the problem. but this is not a practical solution. what if someone implemented my protocol on his own client but did not notify the server ? probably he will crash my server easily.
Also i can easily solve the problem by making each client in a process not in a thread. but this will not be a scalable solution. it will take more memory and slower processing.
how can i solve this problem then ?
Note that i had tested the server on localhost. may this problem be solved if i tested it on a remove server ?
Thanks in advance ..
