# FreeRTOS\_select - Getting eSELECT\_EXCEPT event infinitely

**URL:** <https://forums.freertos.org/t/freertos-select-getting-eselect-except-event-infinitely/21517>\
**Category:** Libraries\
**Tags:** debug\
**Created:** [September 25, 2024, 7:46am UTC](https://forums.freertos.org/t/freertos-select-getting-eselect-except-event-infinitely/21517 "2024-09-25T07:46:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghav](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@Raghav](https://forums.freertos.org/u/Raghav)\
**Post date:** [September 25, 2024, 7:46am UTC](https://forums.freertos.org/t/freertos-select-getting-eselect-except-event-infinitely/21517/1 "2024-09-25T07:46:43Z")

</div>

Hi, I am using FreeRTOS version 10.6.1.  
Scenario is like this:

1. 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.
2. I have a socket-set fd and I am using select function for polling between those sockets for the new connection.
3. I have made two extra socket-sets fd1 and fd2 for client sockets connecting to both the sockets s1 and s2.
4. 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 .
5. 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

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [September 25, 2024, 9:51am UTC](https://forums.freertos.org/t/freertos-select-getting-eselect-except-event-infinitely/21517/2 "2024-09-25T09:51:16Z")

</div>

Thanks for reporting this.

I think that it would be useful to show the source code that is related to the IP-stack. Can you zip and attach it? Thanks

**EDIT**

> Hi, I am using FreeRTOS version 10.6.1.

Can you please also tell where you downloaded FreeRTOS-Plus-TCP, and which version?
