Hi, I am using FreeRTOS version 10.6.1.
Scenario is like this:
- I have two server sockets, s1 and s2 and both are listening on two different ports and they both are being used only for listening. But for now, I am only connecting one client to single port on s1.
- I have a socket-set fd and I am using select function for polling between those sockets for the new connection.
- I have made two extra socket-sets fd1 and fd2 for client sockets connecting to both the sockets s1 and s2.
- I have two different tasks for handling both kind of clients connected on s1 and s2. For eg, for clients connected on s1, I am using task t1 and so on for clients on s2 .
- In these tasks I receive the data from the client sockets and also disconnect the sockets and for handling this i am using FreeRTOS_select function.
Problem: When a client is disconnected, FreeRTOS_select used in the tasks is getting eSELECT_EXCEPT event infinitely from ip task. From what i could understand, the task is RTOS is looping around the eSELECT_EXCEPT event. Like , when it gets eSELECT_EXCEPT event, FreeRTOS_select unblocks and sends a SocketSelect event to IP Task. In IP task, on receiving the event, when it calls the internal function of vSocketSelect, it sees that the state of the socket is eCLOSE_WAIT or eCLOSED, then it sends the eSELECT_EXCEPT event on the respective socket and loop continues.
Please tell me how to solve this problem.
Thanks