2014-04-21 15:58 GMT+02:00 Iñaki Baz Castillo <[email protected]>: > 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.
UPDATE: if side A closes its pipe side (by calling close(fd)) the later side B calls to uv_shutdown(pipe) then the uv_shutdown_cb receives an error "socket is not connected". This means that side B *can* be aware that the other side has closed its socket. Should then side B expect a UV_EOF in the un_read_cb? (note however that it does not happen). Thanks. -- 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.
