After giving this some more thought, I believe that the read and write
wakeups are correct when the connection attempt fails.  I also think
that read() should return ENOTCONN if the socket never got to the
connected state.

I'm not sure how write() should behave.  The Open Group Base
Specifications Issue 7 says:

[ECONNRESET]
    A write was attempted on a socket that is not connected.

[EPIPE]
    A write was attempted on a socket that is shut down for writing, or
    is no longer connected. In the latter case, if the socket is of type
    SOCK_STREAM, a SIGPIPE signal shall also be sent to the thread.

whereas our man page only mentions EPIPE.

I think poll() should set POLLERR and not POLLIN or POLLOUT if the
connection attempt fails.

I think kqueue is fine, but the poll() emulation in apr should map the
connection failure into POLLERR.

_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to