Anyhow, must I call close(fd) when I call to uv_close(pipe) if the
pipe was initiated with uv_pipe_open() ?
If so, when should I call to close() ?

Thanks a lot.

2014-04-21 15:58 GMT+02:00 Iñaki Baz Castillo <[email protected]>:
> Hi,
>
> I connect two Unix Domain Sockets in datagram mode using socketpair():
>
>   socketpair(AF_UNIX, SOCK_DGRAM, 0, fds);
>
> And then, I create two uv_pipe_t and pass each of them one of the fds:
>
>   err = uv_pipe_open(myPipe, fd);
>
>
> So now I can write into one side of the pipe and the other receives it. 
> Perfect.
>
>
> The problem is that when one side of the pipe closes its sockets, the
> remote side does not realize of it (uv_read_cb is not fired with
> UV_EOF). Note that I've tried to close the socket in two ways:
>
>   1) by calling uv_close(handle)
>   2) by calling close(fd)  (in #include <unistd.h>)
>
> None of them causes the remote to be notified. So my question is simple:
>
> Is this because of SOCK_DGRAM usage? This is, regardless both sockets
> are connected (paired), the fact that they use datagrams means than no
> one will be notified at all about "disconnection" from the other, am I
> right?
>
> Thanks a lot.
>
>
> --
> Iñaki Baz Castillo
> <[email protected]>



-- 
Iñaki Baz Castillo
<[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to