def recv(self, buffer_size):
        """Check for closed and broken pipes when receiving data."""
        if self.__filehandle:
            try:
                return file_dispatcher.recv(self, buffer_size)
            except OSError, oe:
                if oe.errno in self.__ignore_errno: self.handle_close()
                else: self.handle_expt()
        return ''
Check for closed and broken pipes when receiving data.
recipes/Python/576967_Asynchronous_pipe_communicatiusing/recipe-576967.py