Il 14/01/2013 10:29, Liu Yuan ha scritto:
> I don't think so. I use netstat to assure that the connection is in
> closed_wait state and I added a printf in the qemu_co_send() and it
> indeed sent successfully, this can be backed by the Linux kernel
> source code:
>
> static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int
> offset,
> size_t size, int flags)
> {
> ....
> /* Wait for a connection to finish. One exception is TCP Fast Open
> * (passive side) where data is allowed to be sent before a connection
> * is fully established.
> */
> if (((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) &&
> !tcp_passive_fastopen(sk)) {
> if ((err = sk_stream_wait_connect(sk, &timeo)) != 0)
> goto out_err;
> }
> ....
> }
>
> which will put data in the sock buf and returns successful in a
> CLOSED_WAIT state. I don't see means in Sheepdog driver code to get a
> HUP notification for a actual cut off connection.
Ok. I guess the problem is that we use select(), not poll(), so we have
no way to get POLLHUP notifications. But the write fd_set receives the
file descriptor because indeed writes will not block.
Stefan, Anthony, any ideas?
Paolo