docs: def SocketWriter(host, port, af=None, st=None):
      """ Writes messages to a socket/host. """
      import socket
      if af is None:
          af = socket.AF_INET
      if st is None:
          st = socket.SOCK_STREAM
      message = '({0}): {1}'
      s = socket.socket(af, st)
      s.connect(host, port)
      try:
          while True:
              logstr = (yield)
              s.send(logstr)
      except GeneratorExit:
          s.close()