aboutsummaryrefslogtreecommitdiffstats
path: root/wpaspy
diff options
context:
space:
mode:
Diffstat (limited to 'wpaspy')
-rw-r--r--wpaspy/wpaspy.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py
index 861bee6..809b4ce 100644
--- a/wpaspy/wpaspy.py
+++ b/wpaspy/wpaspy.py
@@ -109,6 +109,16 @@ class Ctrl:
return None
raise Exception("DETACH failed")
+ def terminate(self):
+ if self.attached:
+ try:
+ self.detach()
+ except Exception, e:
+ # Need to ignore this to allow the socket to be closed
+ self.attached = False
+ self.request("TERMINATE")
+ self.close()
+
def pending(self, timeout=0):
[r, w, e] = select.select([self.s], [], [], timeout)
if r: