Could use some insight into an occasional error we are seeing in our http server application (WICED 6.2), specifically the WICED API “wiced_http_response_stream_write”. When we call this API to write chunks of a web page up to the browser the API will occasionally return the value 4, which from below WICED code is defined generically as “ERROR” (appears a macro is used to expand to “WICED_TCPIP_ERROR” so at least we can search the WICED code for that string). When this error occurs our web page is obviously not rendered correctly. The error is not easily reproducible nor is there any pattern to its occurrence. It is not a “hard” error, our application will continue to function following this error, meaning the user can navigate to another page which will be served and rendered correctly. When the API fails as described our application will retry the API several more times but those retries fail as well, with the same error code.
The generality of this error code makes it difficult to debug. Can you provide some insight into what “Error” may indicate, what may cause this situation, possibly WICED debugging options that can be enabled?
Another error that same library function will sometime return under the same conditions is “socket closed”. When this is seen the current page does not render correctly but typically can back to the previous page which will then be rendered fine. I retry the library function when it returns that error but that did not help. I’m not quite sure what this error may be implying, as the the connection is fine.
#define TCPIP_RESULT_LIST( prefix ) \
RESULT_ENUM( prefix, SUCCESS, 0 ), /**< Success */ \
RESULT_ENUM( prefix, PENDING, 1 ), /**< Pending */ \
RESULT_ENUM( prefix, TIMEOUT, 2 ), /**< Timeout */ \
RESULT_ENUM( prefix, PARTIAL_RESULTS, 3 ), /**< Partial results */ \
RESULT_ENUM( prefix, ERROR, 4 ), /**< Error */ \
RESULT_ENUM( prefix, BADARG, 5 ), /**< Bad Arguments */ \
RESULT_ENUM( prefix, BADOPTION, 6 ), /**< Mode not supported */ \
RESULT_ENUM( prefix, UNSUPPORTED, 7 ), /**< Unsupported function */ \
RESULT_ENUM( prefix, INVALID_PACKET, 7008 ), /**< Invalid packet */ \
RESULT_ENUM( prefix, INVALID_SOCKET, 7009 ), /**< Invalid socket */ \
RESULT_ENUM( prefix, WAIT_ABORTED, 7010 ), /**< Wait aborted */ \
RESULT_ENUM( prefix, PORT_UNAVAILABLE, 7011 ), /**< Port unavailable */ \
RESULT_ENUM( prefix, IN_PROGRESS, 7012 ), /**< Action in progress */ \
RESULT_ENUM( prefix, IP_ADDRESS_IS_NOT_READY, 7013 ), /**< IP_ADDRESS_IS_NOT_READY */ \
RESULT_ENUM( prefix, SOCKET_CLOSED, 7014 ), /**< Socket closed */