MCPcopy Index your code
hub / github.com/RustPython/RustPython / _accept

Method _accept

crates/stdlib/src/socket.rs:1635–1644  ·  view source on GitHub ↗
(
            &self,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

1633
1634 #[pymethod]
1635 fn _accept(
1636 &self,
1637 vm: &VirtualMachine,
1638 ) -> Result<(RawSocket, PyObjectRef), IoOrPyException> {
1639 // Use accept_raw() instead of accept() to avoid socket2's set_common_flags()
1640 // which tries to set SO_NOSIGPIPE and fails with EINVAL on Unix domain sockets on macOS
1641 let (sock, addr) = self.sock_op(vm, SelectKind::Read, || self.sock()?.accept_raw())?;
1642 let fd = into_sock_fileno(sock);
1643 Ok((fd, get_addr_tuple(&addr, vm)))
1644 }
1645
1646 #[pymethod]
1647 fn recv(

Callers 1

acceptMethod · 0.80

Calls 4

into_sock_filenoFunction · 0.85
get_addr_tupleFunction · 0.85
sock_opMethod · 0.80
sockMethod · 0.80

Tested by

no test coverage detected