Winsock API function Encyclopedia 3

Source: Internet
Author: User
Tags bool socket

The Windows Sockets API interface provided by this system (winking) is a function (routine) as defined in version 1.1 of WINSOCK (as appendix) published on January 20, 1993; includes 30 Berkeley Software Dis Tribution (BSD) function and 16 functions that conform to the Windows message-driven feature.

SetSockOpt (): Sets the state of the Socket.

Format: int PASCAL FAR setsockopt (SOCKET s,int level,int optname,const char FAR *optval,int);

Parameters: s Socket identification code, level option set level,optname option name, optval option set value, Optlen option set value length

Return value: Success-0

Failed-Socket_error (call WSAGetLastError () for reasons)

Description: This function is used to set some options for the Socket to change its action.

The options that can be changed are: (see Winsock version 1.1, page 54)

Value Type

-----------------------------------------------

So_broadcast BOOL

*so_debug BOOL

So_dontlinger BOOL

*so_dontroute BOOL

*so_keepalive BOOL

So_linger struct Linger far*

So_oobinline BOOL

*so_rcvbuf int

SO_REUSEADDR BOOL

*so_sndbuf int

Tcp_nodelay BOOL

() shutdown (): Stop Socket receive/transmit function.

Format: int PASCAL FAR shutdown (SOCKET s, int how);

Parameter: The identifier of the S Socket, how do I represent the flag that should stop those actions

Return value: Success-0

Failed-Socket_error (call WSAGetLastError () for reasons)

Description: This function is used to stop the subsequent receipt or transfer of the Socket.

If you have a value of 0, you no longer receive data.

If the value of how is 1, the transfer of data is no longer allowed.

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.