ioctlsocket

[DllImport("ws2_32.dll", SetLastError = true)]
public static extern int ioctlsocket(
   IntPtr s,
   long cmd,
   ref uint argp
);

Microsoft documentation: Link

Last updated