code: def _write(self, s):
          
          try:
              write = self.sock.write
          except AttributeError:
              # Works around a bug in python socket library
              raise IOError('Socket closed')
          else:
              while s:
                  n = write(s)
                  if not n:
                      raise IOError('Socket closed')
                  s = s[n:]
docs: Write a string out to the SSL socket fully.