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