[code.view]

[top] / python / PyMOTW / asyncore / asyncore_loop.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2009 Doug Hellmann All rights reserved.
     #
     """
     """
     
     __version__ = "$Id$"
     #end_pymotw_header
     
     import asyncore
     import logging
     
     from asyncore_http_client import HttpClient
     
     logging.basicConfig(level=logging.DEBUG,
                         format='%(name)s: %(message)s',
                         )
     
     clients = [
         HttpClient('http://www.doughellmann.com/PyMOTW/contents.html'),
         HttpClient('http://www.python.org/'),
         ]
     
     loop_counter = 0
     while asyncore.socket_map:
         loop_counter += 1
         logging.debug('loop_counter=%s', loop_counter)
         asyncore.loop(timeout=1, count=1)
     

[top] / python / PyMOTW / asyncore / asyncore_loop.py

contact | logmethods.com