Socket ioctl

 

/* Set socket in blocking/non-blocking mode. */

 

#include "m2m_type.h"

#include "m2m_socket_api.h"

 

INT32 on = 1;

 

/* ... Create socket and connect ... */

 

/* Set socket in non blocking mode */

if (0 != m2m_socket_bsd_ioctl (SocketFD, M2M_SOCKET_BSD_FIONBIO, &on))

 {

   /* error setting to non blocking */

 }

 

 on = 0;

 

/* Set socket in blocking mode */

if (0 != m2m_socket_bsd_ioctl (SocketFD, M2M_SOCKET_BSD_FIONBIO, &on))

 {

   /* error setting to blocking */

 }