Hi David,
Thank you for your reply.
Here is the snippet of the code calling wolfssl_read.
//Receive data from socket.
char buf[RECV_BUFFER_SIZE_BYTES] = {0}; //16384 bytes
while (true)
{
memset(buf, 0, RECV_BUFFER_SIZE_BYTES);
// Wait for client to send data
ssize_t bytesReceived = wolfSSL_read(reinterpret_cast<WOLFSSL*>(pReqHandler->getContext()), buf, sizeof(buf));
if (bytesReceived < 0)
{
ERROR1("\r\nwolfSSL_read", "requestHandlerThreadProc()", getWolfSSLErrString(pReqHandler->getContext()));
break;
}
if (bytesReceived == SSL_ERROR_WANT_READ || bytesReceived == SSL_ERROR_WANT_WRITE)
{
continue;
}
if (bytesReceived == 0)
{
break;
}
}
vTaskDelete(NULL);
The above function runs in thread. For each socket separate thread will be created. "sys_thread_new" function (LwIP library function) used to create threads.
Here is the log info of wolfSSL after adding DEBUG_WOLFSSL.
wolfSSL Entering wolfSSL_read()
wolfSSL Entering wolfSSL_read_internal()
wolfSSL Entering ReceiveData()
growing input buffer
received record layer msg
got ALERT!
wolfSSL error occurred, error = -132
wolfSSL Leaving wolfSSL_read_internal(), return -132
Regards,
Iyyappan.