Re: sock_recvmsg in Kernel hangs for 10 seconds

From: David S. Miller (davem@redhat.com)
Date: Fri May 12 2000 - 21:10:03 EST


   Date: Fri, 12 May 2000 21:22:07 -0400 (EDT)
   From: Lee Chin <leechin@mail.com>

   It must be something wrong that I am doing, but once in a while the
   following sock_recvmsg hangs for 10 seconds even though the client the
   socket is connected to has returned all data...

 ...

   How do I fix this?

Make the server close the socket when it's sent all the data.

The kernel has no idea if "all the data" has been sent until it sees
the close from the sender, but the kernel does use a timeout so that
you do not block forever in MSG_WAITALL if the server does not close
the connection.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:22 EST