From 53349343e9ac54871e3de1fe9bc8069a55d3096e Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 7 Jun 2016 20:38:23 -0500 Subject: [PATCH] Added NSAPI_KEEPIDLE option to the socket API and LWIPInterface --- LWIPInterface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/LWIPInterface.cpp b/LWIPInterface.cpp index 55f65c821c..74cf9c1646 100644 --- a/LWIPInterface.cpp +++ b/LWIPInterface.cpp @@ -557,6 +557,14 @@ int LWIPInterface::setsockopt(void *handle, int level, int optname, const void * s->tcp->so_options |= SOF_KEEPALIVE; return 0; + case NSAPI_KEEPIDLE: + if (optlen != sizeof(int) || s->proto != NSAPI_TCP) { + return NSAPI_ERROR_UNSUPPORTED; + } + + s->tcp->keep_idle = *(int*)optval; + return 0; + case NSAPI_KEEPINTVL: if (optlen != sizeof(int) || s->proto != NSAPI_TCP) { return NSAPI_ERROR_UNSUPPORTED;