From 009b22f7cead9bf9bb0a5d66fbe6dc653e0f8057 Mon Sep 17 00:00:00 2001 From: Minji Park Date: Tue, 15 Nov 2016 16:30:02 +0900 Subject: [PATCH] Add shutdown() to disable send/receive on a socket in catcpserver - Add shutdown() before close socket when closing connection in catcpserver Change-Id: Ibe2ed942428f754dc148bd1c48422036f84a319c Signed-off-by: Minji Park Reviewed-on: https://gerrit.iotivity.org/gerrit/14343 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Hyuna Jo Reviewed-by: Uze Choi Reviewed-by: Ashok Babu Channa --- resource/csdk/connectivity/src/tcp_adapter/catcpserver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c index 4135b65..1b389f9 100644 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c @@ -1125,6 +1125,7 @@ CAResult_t CADisconnectTCPSession(CATCPSessionInfo_t *svritem, size_t index) // close the socket and remove TCP connection info in list if (svritem->fd >= 0) { + shutdown(svritem->fd, SHUT_RDWR); close(svritem->fd); } u_arraylist_remove(caglobals.tcp.svrlist, index); -- 2.7.4