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

Method dup

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

dup() -> socket object Duplicate the socket. Return a new socket object connected to the same system resource. The new socket is non-inheritable.

(self)

Source from the content-addressed store, hash-verified

274 raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")
275
276 def dup(self):
277 """dup() -> socket object
278
279 Duplicate the socket. Return a new socket object connected to the same
280 system resource. The new socket is non-inheritable.
281 """
282 fd = dup(self.fileno())
283 sock = self.__class__(self.family, self.type, self.proto, fileno=fd)
284 sock.settimeout(self.gettimeout())
285 return sock
286
287 def accept(self):
288 """accept() -> (socket object, address info)

Callers

nothing calls this directly

Calls 4

filenoMethod · 0.45
__class__Method · 0.45
settimeoutMethod · 0.45
gettimeoutMethod · 0.45

Tested by

no test coverage detected