how to write a simple bittorrent application?,time.sleep(1)