Skip to contentSkip to conversation

close.2: Mention a need of shutdown before closing socket

PATCH Peter Schiffer 1 participant 1 message Feb 12, 2013 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

ping Michael

Quoted 33 lines · Michael Kerrisk

Hi Lukas

Quoted 13 lines · Lukas Czerner
Quoted 11 lines · Michael Kerrisk

Lukas,

Quoted 4 lines · Lukas Czerner

When dealing with sockets, we have to be sure that there is no recv still blocking on it on another thread, otherwise it might block forever, since no more messages will be send via the socket. We should advice to use shutdown before closing socket.

I'm looking into this now. The picture may be more complex than this. Tell me, so you have a Solaris system available for testing?

Quoted 8 lines
Quoted 1 line

Thanks,

Hi Michael,

Thanks for looking into this. Unfortunately I do not have any Solaris system for testing, that was a customer report. His complaint was mainly not because the behaviour on Linux differs, but because this was not documented anywhere.

Okay. I will see if I can find a test system somewhere. (The system I used to use seems to have gone away.)

Just FYI: I confirmed what you are seeing, but the issue seems more
general: basically, closing a file descriptor in one thread while reading in another thread does not cause the read operation to terminate (it will still read data if/when it becomes available).

Quoted 8 lines

By the way, I'm wondering about creating a small repo of test programs. I might like to add a modified version of your test program to that repo. Can you put that code under a Free License and supply a copyright?

Thanks,

Michael

Hi Michael,

no problem, here is the program, feel free to update it as you like. Thanks for looking into this.

-Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html