Create a socket.

Syntax

SOCKET SocketSc(
  unsigned short u16Domain, 
  unsigned char u8Type,
  unsigned char u8Flags
);

Parameters

u16Domain
[in] Please specify AF_INET. (Other domains are not supported)
u8Type
[in] Specify the socket type.
ValueDescription
SOCK_STREAM TCP
SOCK_DGRAM UDP
u8Flags
[in] Specify SOCKET_FLAGS_SSL for SSL communication and 0 for other cases.

Return value

The following values will be returned.
ValueDescription
-1 Failed
0〜10 Socket descriptor
M2M_ERR_SLEEP_FAIL Initialize with SysWLANInit function.

Remarks

Generate a socket.

Requirements

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

Sample

Last updated: 2020/11/26