SWRU368C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
Table 5-1 describes a list of supported BSD sockets and the corresponding SimpleLink implementation.
BSD Socket | Simplelink Implementation | Server/ Client Side | TCP/ UDP | Description |
---|---|---|---|---|
socket() | sl_Socket() | Both | Both | Creates an endpoint for communication |
bind() | sl_Bind() | Server | Both | Assigns a socket to an address |
listen() | sl_Listen() | Server | Both | Listens for connections on a socket |
connect() | sl_Connect() | Client | Both | Initiates a connection on a socket |
accept() | sl_Accept() | Server | TCP | Accepts an incoming connection on a socket |
send(), recv() | sl_Send(), sl_Recv() | Both | TCP | Writes and reads data to and from TCP socket. |
write(), read() | Not Supported | |||
sendto(), recvfrom() | sl_SendTo(), sl_RecvFrom() | Both | UDP | Writes and reads data to and from UDP socket |
close() | sl_Close() | Both | Both | Causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated. |
gethostbyname(), gethostbyaddr() | Not Supported | |||
select() | sl_Select() | Both | Both | Used to pend, waiting for one or more of a provided list of sockets to be ready to read, ready to write, or that have errors |
poll() | Not supported | |||
getsockopt() | sl_SockOpt() | Both | Both | Retrieves the current value of a particular socket option for the specified socket |
setsockopt() | sl_SetSockOpt() | Both | Both | Sets a particular socket option for the specified socket |
htons(), ntohs() | sl_Htons(), sl_Ntohs() | Both | Both | Reorders the bytes of a 16-bit unsigned value from processor order to network order |
htonl(), ntohl() | sl_Htonl(), sl_Ntohl() | Both | Both | Reorders the bytes of a 32-bit unsigned value from processor order to network order |