WSAStartup

The first call to WSAStartup initiates the use of eRTOS TCP/IP stack by a process. Subsequent calls to WSAStartup increment a startup count. An application must perform an equal number of WSACleanup calls, which would decrement a startup count. The final call performs an actual cleanup.

Syntax

Copy
int WSAStartup(
    WORD wVersionRequested,
    LPWSADATA lpWSAData
);

Parameters

wVersionRequested

The highest version of WinSock support that the caller can use.  The high order byte specifies the minor version (revision) number; the low-order byte specifies the major version number.

lpWSAData

A pointer to the WSADATA data structure that is to receive details of the WinSock implementation.

Return Value

If the function succeeds, it returns 0 (zero).

If the function fails, it returns one of these error codes:

Error Code

Description

WSAEFAULT

The lpWSAData parameter is an invalid pointer.

WSAVERNOTSUPPORTED

The version of WinSock support requested is not provided by this Winsock implementation.

WSASYSNOTREADY

Network kernel is not ready for network communications.

Remarks

The WSAStartup function should only be called once within a process.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Winsock2.h RtTcpipApi.lib