This function sets options for the specified socket.

Syntax

int setsockopt(
  SOCKET sock, 
  unsigned char u8Level, 
  unsigned char option_name, 
  const void *option_value, 
  unsigned short u16OptionLen
);

Parameters

sock
[in] Socket descriptor
u8Level
[in] Specifies the protocol level.
ValueDescription
SOL_SOCKET Socket option.
SOL_SSL_SOCKET SSL option.
option_name
[in] Specify the options.
ValueDescription
[u8Level = SOL_SOCKET] SO_SET_UDP_SEND_CALLBACK:
Enables / disables UDP callbacks.
[u8Level = SOL_SSL_SOCKET] SO_SSL_BYPASS_X509_VERIF:
Allows the socket to bypass the X509 certificate validation process.
option_value
[in] Specify the pointer of the setting value.
ValueDescription
[u8Level = SOL_SOCKET
option_name = SO_SET_UDP_SEND_CALLBACK]
Specifies a pointer to an int type setting value that indicates Enable / Disable.
1:ENABLE
0:DISABLE
[u8Level = SOL_SSL_SOCKET
option_name = SO_SSL_BYPASS_X509_VERIF]
Specifies a pointer to an int type setting value that indicates Enable / Disable.
1:ENABLE
0:DISABLE
u16OptionLen
[in] Specify the size (bytes) of the set value.

Return value

The following values will be returned.
ValueDescription
SOCK_ERR_NO_ERROR Succeeded
M2M_ERR_SLEEP_FAIL Initialize with SysWLANInit function.
Other than the above Failed

Remarks

Sets options for the specified socket.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Last updated: 2020/11/26