[tor-commits] [torflow/master] Update metatroller example to use new TorCtl.connect..

mikeperry at torproject.org mikeperry at torproject.org
Sat Jun 25 17:39:47 UTC 2011


commit 07cbb7c90d1335043e7ce00d85102b18003ca1c9
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Sat Jun 25 10:39:03 2011 -0700

    Update metatroller example to use new TorCtl.connect..
---
 metatroller.py |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/metatroller.py b/metatroller.py
index dc6ff6c..3449249 100755
--- a/metatroller.py
+++ b/metatroller.py
@@ -305,11 +305,8 @@ def listenloop(c, h, f):
   srv.close()
 
 def startup():
-  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-  s.connect((control_host,control_port))
-  c = PathSupport.Connection(s)
+  c = TorCtl.connect(control_host, control_port, ConnClass=PathSupport.Connection)
   c.debug(file("control.log", "w", buffering=0))
-  c.authenticate(control_pass)
   h = PathSupport.PathBuilder(c, __selmgr) # StatsHandler(c, __selmgr)
 
   c.set_event_handler(h)



More information about the tor-commits mailing list