(self, str)
Send `str' to the server.
Send `str' to the server.
Send str to the server .
def send(self, str):
        """Send `str' to the server."""
        if self.sock is None:
            if self.auto_open:
                self.connect()
            else:
                raise NotConnected()

        # send the data to the server. if we get a broken pipe, then close
        # the socket. we want to reconnect when somebody tries to send again.
        #
        # NOTE: we DO propagate the error, though, because we cannot simply
        #       ignore the error... the caller will know if they can retry.
        if self.debuglevel > 0:
            print "send:", repr(str)
        try:
            self.sock.send(str)
        except socket.error, v:
            if v[0] == 32:      # Broken pipe
                self.close()
            raise
def send ( self , str ) : if self . sock is None : if self . auto_open : self . connect ( ) else : raise NotConnected ( ) # send the data to the server. if we get a broken pipe, then close # the socket. we want to reconnect when somebody tries to send again. # # NOTE: we DO propagate the error, though, because we cannot simply #       ignore the error... the caller will know if they can retry. if self . debuglevel > 0 : print "send:" , repr ( str ) try : self . sock . send ( str ) except socket . error , v : if v [ 0 ] == 32 : # Broken pipe self . close ( ) raise