socket function winsock

Win32Result<SOCKET> socket(
  1. int af,
  2. WINSOCK_SOCKET_TYPE type,
  3. int protocol
)

Creates a socket that is bound to a specific transport service provider.

To learn more, see learn.microsoft.com/windows/win32/api/winsock2/nf-winsock2-socket.

Implementation

Win32Result<SOCKET> socket(int af, WINSOCK_SOCKET_TYPE type, int protocol) {
  final result_ = socket_Wrapper(af, type, protocol);
  return .new(value: .new(result_.value.i64), error: result_.error);
}