MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / socketpair

Function socketpair

tools/python-3.11.9-amd64/Lib/socket.py:595–611  ·  view source on GitHub ↗

socketpair([family[, type[, proto]]]) -> (socket object, socket object) Create a pair of socket objects from the sockets returned by the platform socketpair() function. The arguments are the same as for socket() except the default family is AF_UNIX if defined on

(family=None, type=SOCK_STREAM, proto=0)

Source from the content-addressed store, hash-verified

593if hasattr(_socket, "socketpair"):
594
595 def socketpair(family=None, type=SOCK_STREAM, proto=0):
596 """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
597
598 Create a pair of socket objects from the sockets returned by the platform
599 socketpair() function.
600 The arguments are the same as for socket() except the default family is
601 AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
602 """
603 if family is None:
604 try:
605 family = AF_UNIX
606 except NameError:
607 family = AF_INET
608 a, b = _socket.socketpair(family, type, proto)
609 a = socket(family, type, proto, a.detach())
610 b = socket(family, type, proto, b.detach())
611 return a, b
612
613else:
614

Callers

nothing calls this directly

Calls 9

socketClass · 0.85
getsocknameMethod · 0.80
setblockingMethod · 0.80
detachMethod · 0.45
bindMethod · 0.45
listenMethod · 0.45
connectMethod · 0.45
acceptMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected