/* listen for connections on a socket The willingness to accept incoming connections and a queue limit for incoming connections are specified with 
listen */
INT32 CC3000_EXPORT() listen(INT32 sd, INT32 backlog)
/* listen for connections on a socket The willingness to accept incoming connections and a queue limit for incoming connections are specified with 
listen */
INT32 CC3000_EXPORT() listen(INT32 sd, INT32 backlog)
{
	INT32 ret;
	UINT8 *ptr, *args;
	ret = EFAIL;
	ptr = tSLInformation.pucTxCommandBuffer;
	args = (ptr + HEADERS_SIZE_CMD);
	args = UINT32_TO_STREAM(args, sd);
	args = UINT32_TO_STREAM(args, backlog);
	hci_command_send(HCI_CMND_LISTEN,
		ptr, SOCKET_LISTEN_PARAMS_LEN);
	SimpleLinkWaitEvent(HCI_CMND_LISTEN, &ret);
	CC3000_EXPORT(errno) = ret;
	return(ret);
}