mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
#9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa.
This commit is contained in:
parent
8182b717db
commit
cbb0ae4a42
4 changed files with 24 additions and 1 deletions
|
@ -607,6 +607,14 @@ if os.name == 'posix':
|
|||
def send(self, *args):
|
||||
return os.write(self.fd, *args)
|
||||
|
||||
def getsockopt(self, level, optname, buflen=None):
|
||||
if (level == socket.SOL_SOCKET and
|
||||
optname == socket.SO_ERROR and
|
||||
not buflen):
|
||||
return 0
|
||||
raise NotImplementedError("Only asyncore specific behaviour "
|
||||
"implemented.")
|
||||
|
||||
read = recv
|
||||
write = send
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue