How does the shutdowns function in socket programming realy work?
I have tried to used it in a multi-threaded application. If I have a recv thread that is hanging on the recv thread, and I use the function shutdown(fd, SHUT_RDWR) in a other thread the recv thread do get out of the recv function.
But if I do use the shutdown(fd, SHUT_RD), the recv thread is only hanging on the recv function.
If I also have send thread and I have called shutdown(SHUT_WR) from another thread, the send thread hangs on the send function.
Have I done some total wrong when I have tested it? Or is this how it does work?
I have tried it out on a linux system