Collection of wsasocket () Problems

Source: Internet
Author: User

 

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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.