Hi Ravindra Gurjar
The SO_LINGER socket option indicates how the socket is to be shut down: either gracefully or with an abort operation (TCP reset). If the socket is to be shut down gracefully, RTCS tries to deliver all the data that is in its send buffer for the socket. If you shutting down with an abort operation, RTCS immediately discards the socket and the socket's internal send and receive buffers; The remote endpoint frees its socket immediately after it sends all the data that is in its send buffer.
Please check the MQX_RTCS_User_Guide.pdf for more details. P110, closesocket()

Please check the following code to use SO_LINGER socket options:
struct linger l_options;
/* Set linger options for RST flag sending. */
l_options.l_onoff = 1;
l_options.l_linger_ms = 0;
setsockopt(sock, SOL_SOCKET, SO_LINGER, &l_options, sizeof(l_options));
closesocket(sock);
Note: If this post is helpful, please mark correct or helpful, thank you
Regards
Daniel