Other Parts Discussed in Thread: CC3235MODSF,
Hi,
We are developing an application as a TCP client using the following components:
Custom hardware with CC3235MODSF
SIMPLELINK-CC32XX-SDK Version: 5.20.00.06
Service Pack Version: 4.11.0.0
We are using the Simplelink API to connect to a server using Telnet. After Telnet negotiation the application is just a terminal emulator. Here is how we open the socket:
/* Create a client socket for telnet. */ sd = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, 0); /* Try to connect to server. */ sl_Connect(sd, (SlSockAddr_t *)&addr, sizeof(SlSockAddr_t)); /* Block socket to receive first byte. */ rs = sl_Recv(sd, gp_buff, 1, 0);
Our problem is happening when we get an error from the socket. Sometimes sl_Recv returns 0 even though we block the socket for receiving 1 byte. In that case, we have to close the socket by calling sl_Close and open it back again. However, this causes multiple sessions on the server side. One of our customers has warned us about the issue because these multiple sessions are causing unnecessary rise of RAM usage on their machines.
Why do you think that the socket is not closed properly? Can we somehow make sure that our device closes the socket successfully?
Thank you for your help.
Best,
Ogulcan