diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-06-11 18:51:31 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-11 18:51:31 +0000 |
| commit | e3262dbfc23c53fa4e9c9040ab1077ebb9b621f0 (patch) | |
| tree | ff33add4aa5e036f534f23cab18ba36adb2d9390 /python/qpid/util.py | |
| parent | 03d7dcc8595a1fdcde14d9aa2729651888a3c051 (diff) | |
| download | qpid-python-e3262dbfc23c53fa4e9c9040ab1077ebb9b621f0.tar.gz | |
fixed ssl close
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@783872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/util.py')
| -rw-r--r-- | python/qpid/util.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/python/qpid/util.py b/python/qpid/util.py index c1ea2d60d6..c46716b88f 100644 --- a/python/qpid/util.py +++ b/python/qpid/util.py @@ -22,7 +22,21 @@ import os, socket, time, textwrap, re try: from ssl import wrap_socket as ssl except ImportError: - from socket import ssl + from socket import ssl as wrap_socket + class ssl: + + def __init__(self, sock): + self.sock = sock + self.ssl = wrap_socket(sock) + + def recv(self, n): + return self.ssl.read(n) + + def send(self, s): + return self.ssl.write(s) + + def close(self): + self.sock.close() def connect(host, port): sock = socket.socket() |
