 |
|
| Linux Forum Index » Linux Development » recv() vs. close() |
|
Page 1 of 1 |
|
| Author |
Message |
| Martin Vuille |
Posted: Fri Apr 20, 2007 10:43 am |
|
|
|
Guest
|
I'm new to socket programming, so apologies in advance if my use of
terminology is incorrect or confusing. Please feel free to correct
me.
I'm trying to understand a problem in some code I did not write and
which I cannot post here.
Let's say that I have a Unix-domain socket (PF_UNIX) in datagram
(SOCK_DGRAM) and multicast mode (UNIX_SET_MCAST in setsockopt), with
membership established to a "wildcard" multicast address
(UNIX_ADD_MEMBERSHIP in setsockopt, with sun_family = PF_UNIX,
sun_path[0] = 0).
One process has a recv() pending on its socket.
Another process does a sendmsg() to its socket and then immediately
does a close() on it.
What will the first process see? Will it receive the message and then
an error on the next recv(), or only an error, or ??? Which error?
How would this change if instead of two processes, we have two
threads in the same process, and both are using the same socket/FD?
In case it matters, this is on Linux 2.4.
--
I do not want replies; please follow-up to the group. |
|
|
| Back to top |
|
|
|
|
|
All times are GMT - 5 Hours
The time now is Mon Nov 30, 2009 7:27 am
|
|