Question 1: What is the difference between wsasocket () and socket () functions?
When I was learning Windows Network Programming, I saw two functions create a socket. What is the difference between the socket created by these two functions? Are they just getting different parameter information? Are they used in different places?
Socket wsasocket (int af, int type, int protocol,
Lpwsaprotocol_info lpprotocolinfo,
Group G, DWORD dwflags)
Socket socket (int af, int type, int Protocol)
Reply to: repus ()
The socket is compatible with Unix and is equivalent to calling wsasocket with the default option.
Wsasocket can use special Winsock functions, such as overlapping Io, which are specified with dwflags.
Question 2: What does WSA in wsasocket mean?
Reply to: Warton (management confusion)
Wsa a refers to the API used to differentiate SPI, because in SPI there are also wspsocket, wspaccept and so on...
In spi:
WSP (Winsock provider): used to transmit service provider functions.
NSP (namespace provider): used for namespace provider functions.
WPU (Winsock provider raise): WS2 _ 32. dll supported functions for the service provider to call.
WSC (Winsock configuration): used to install functions of the service provider in WinSock 2.
Let's talk about WinSock in two parts: Winsock API, Winsock Spi...