INT32 m2m_socket_bsd_send(M2M_SOCKET_BSD_SOCKET s, const void *buf, INT32 len,
INT32 flags)
Description: the function sends data using the specified socket. Depending on the socket configuration, this function can perform in blocking or non-blocking mode. In case of blocking mode, the function waits for the availability of all the needed stack resources and will not return the control until data is sent (not necessarily all requested data). In case of non-blocking mode, it will try to send the data using only the available stack resources at that time, and will not wait for resources to be free.
Parameters:
s: socket handle;
buf: pointer to the allocated buffer filled with the data to be sent.
len: total number of characters written in the allocated buffer. The size of the buffer should be
larger enough to contain the data.
flags: not supported, ignored. Set it to 0.
Return value:
on success: number of bytes sent.
on failure: < 0
NOTE: m2m_socket_errno(…) function returns the failure reason.
Examples: 19.1.12 TCP-Client, 19.1.13 TCP-Server