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

Function WSAConnect

crates/stdlib/src/overlapped.rs:1914–1936  ·  view source on GitHub ↗
(socket: isize, address: PyTupleRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1912
1913 #[pyfunction]
1914 fn WSAConnect(socket: isize, address: PyTupleRef, vm: &VirtualMachine) -> PyResult<()> {
1915 use windows_sys::Win32::Networking::WinSock::{SOCKET_ERROR, WSAConnect, WSAGetLastError};
1916
1917 let (addr_bytes, addr_len) = parse_address(&address, vm)?;
1918
1919 let ret = unsafe {
1920 WSAConnect(
1921 socket as _,
1922 addr_bytes.as_ptr() as *const SOCKADDR,
1923 addr_len,
1924 core::ptr::null(),
1925 core::ptr::null_mut(),
1926 core::ptr::null(),
1927 core::ptr::null(),
1928 )
1929 };
1930
1931 if ret == SOCKET_ERROR {
1932 let err = unsafe { WSAGetLastError() } as u32;
1933 return Err(set_from_windows_err(err, vm));
1934 }
1935 Ok(())
1936 }
1937
1938 #[pyfunction]
1939 fn CreateEvent(

Callers

nothing calls this directly

Calls 4

parse_addressFunction · 0.85
set_from_windows_errFunction · 0.85
ErrClass · 0.50
as_ptrMethod · 0.45

Tested by

no test coverage detected