This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have a single Ethernet Client task started by the TCP/IP initialization callback that opens up a socket every ~15 seconds, sends data to the server, receives data from the server, and closes the socket.
My sequence of commands is:
fdOpenSession
while(1)
socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)
connect
send
recv
shutdown (tried with and without this)
fdClose
Problem: Every “socket” statement allocates a new 512 byte socket until there is no available heap available.
Do I have to start a task that will fdOpenSession/fdCloseSession for each transaction?
Is there another way to accomplish this task?
Version:
tirtos_1_01_00_25 (can’t update as I am using a Stellaris part (LM3S9B90) and this is the last release to support it)
If the Server remains in a CLOSE_WAIT state between connections the socket creation allocates a new FD. If the Server shuts down the connection completely or goes to a TIME_WAIT state, the socket FD allocation reuses the same address.