close the other half of the pipe in do_recv(). This fixes the problem