mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
asyncio doc: socket.socketpair() is not available on Windows yet
This commit is contained in:
parent
04e6df330d
commit
ccd8e34508
3 changed files with 15 additions and 6 deletions
|
|
@ -521,10 +521,13 @@ Wait until a socket receives data using the
|
|||
the event loop ::
|
||||
|
||||
import asyncio
|
||||
import socket
|
||||
try:
|
||||
from socket import socketpair
|
||||
except ImportError:
|
||||
from asyncio.windows_utils import socketpair
|
||||
|
||||
# Create a pair of connected sockets
|
||||
rsock, wsock = socket.socketpair()
|
||||
rsock, wsock = socketpair()
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
class MyProtocol(asyncio.Protocol):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue