Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Luciano Rocha <strange@xxxxxxxxxxxxx>
- Date: Fri, 12 Oct 2007 11:30:40 +0100
On Fri, Oct 12, 2007 at 11:25:34AM +0100, Howard Wilkinson wrote:
Luciano Rocha wrote:
......I attach a slightly improved version. This sleeps for an hour on both sides.
Is there a reason for using SOCK_DGRAM instead of the usual SOCK_STREAM?
The latter will make the recv return 0, indicating the other end closed
the connection, as it did happen, as one peers exits before the other
select(2)s:
$ ./socketpair server - Socket is ready to write
server - Socket is not ready to read
exited: 14520
master - Socket is ready to write
master - Socket is ready to read
master - recv - Resource temporarily unavailable(11)
This could be a bug, or standard behaviour for disconnected datagram
sockets (I don't know enough of the standards).
I have tried removing the MSG_DONTWAIT but still get the same response.
The SOCK_DGRAM is because I have small packets flowing that I do not want
fragmented but do not mind if they get lost, .... but then inside a machine
that does not matter. However with SOCK_STREAM I get zero length messages
but still ready to read continuously!!! See attached!
Yes, that means the other end closed the connection. EOF isn't set in
efds, but in rds.
Also, see poll(2) if you'll be waiting on a small number of file
descriptors.
--
lfr
0/0
Attachment:
pgpFV0BIfCfpo.pgp
Description: PGP signature
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- References:
- Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Howard Wilkinson
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Gordon Messmer
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Howard Wilkinson
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Stephen Croll
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Howard Wilkinson
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Luciano Rocha
- Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- From: Howard Wilkinson
- Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- Prev by Date: Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- Next by Date: Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- Previous by thread: Re: Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!
- Next by thread: Duplicating a F7 installation.
- Index(es):
Relevant Pages
|