parameters: (self, str)
docstring: Send `str' to the server.
docstring_summary: Send `str' to the server.
docstring_tokens: Send str to the server .
function: 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:
              blocksize=8192
              if hasattr(str,'read') and not isinstance(str, array):
                  if self.debuglevel > 0: print "sendIng a read()able"
                  data=str.read(blocksize)
                  while data:
                      self.sock.sendall(data)
                      data=str.read(blocksize)
              else:
                  self.sock.sendall(str)
          except socket.error, v:
              if v[0] == 32:      # Broken pipe
                  self.close()
              raise
function_tokens: 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 : blocksize = 8192 if hasattr ( str , 'read' ) and not isinstance ( str , array ) : if self . debuglevel > 0 : print "sendIng a read()able" data = str . read ( blocksize ) while data : self . sock . sendall ( data ) data = str . read ( blocksize ) else : self . sock . sendall ( str ) except socket . error , v : if v [ 0 ] == 32 : # Broken pipe self . close ( ) raise