diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2011-08-22 01:55:57 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2011-08-22 01:55:57 (GMT) |
commit | 96fe56abec36d2cb82c56c9ddafea0096f4f6c7e (patch) | |
tree | fa5e6293d1fc1cc00b41c57cd192df49a6a6b7ff /Lib/ssl.py | |
parent | 8983729dc08a05d5419d35ec3f431c7b442401a6 (diff) | |
download | cpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.zip cpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.tar.gz cpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.tar.bz2 |
Add support for the send/recvmsg API to the socket module. Patch by David Watson and Heiko Wundram. (Closes #6560)
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r-- | Lib/ssl.py | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -355,6 +355,14 @@ class SSLSocket(socket): else: return socket.sendto(self, data, flags_or_addr, addr) + def sendmsg(self, *args, **kwargs): + self._checkClosed() + if self._sslobj: + raise ValueError("sendmsg not allowed on instances of %s" % + self.__class__) + else: + return socket.sendmsg(self, *args, **kwargs) + def sendall(self, data, flags=0): self._checkClosed() if self._sslobj: @@ -413,6 +421,22 @@ class SSLSocket(socket): else: return socket.recvfrom_into(self, buffer, nbytes, flags) + def recvmsg(self, *args, **kwargs): + self._checkClosed() + if self._sslobj: + raise ValueError("recvmsg not allowed on instances of %s" % + self.__class__) + else: + return socket.recvmsg(self, *args, **kwargs) + + def recvmsg_into(self, *args, **kwargs): + self._checkClosed() + if self._sslobj: + raise ValueError("recvmsg_into not allowed on instances of %s" % + self.__class__) + else: + return socket.recvmsg_into(self, *args, **kwargs) + def pending(self): self._checkClosed() if self._sslobj: |