<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netxduo.git/test/regression/bsd_test/netx_bsd_select_improvements_test.c, branch dev</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/netxduo.git/atom/test/regression/bsd_test/netx_bsd_select_improvements_test.c?h=dev</id>
<link rel='self' href='http://cgit.235523.xyz/netxduo.git/atom/test/regression/bsd_test/netx_bsd_select_improvements_test.c?h=dev'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/'/>
<updated>2026-05-29T13:15:07Z</updated>
<entry>
<title>Implemented BSD select improvements (#375)</title>
<updated>2026-05-29T13:15:07Z</updated>
<author>
<name>mzgrebnak</name>
<email>michal.zgrebnak@rockwellautomation.com</email>
</author>
<published>2026-05-29T13:15:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/netxduo.git/commit/?id=53070b69eed6af6840b0a890fe749e73e3f280f2'/>
<id>urn:sha1:53070b69eed6af6840b0a890fe749e73e3f280f2</id>
<content type='text'>
* initial support

* bsd: address PR review feedback

- Fix accept() regression: preserve accepted socket FD even when
  recreating the secondary listen socket fails due to slot exhaustion.
  Set secondary_socket_id = NX_BSD_MAX_SOCKETS to invalidate the slot
  for future accept() calls, but still return the already-accepted FD.

- Restore select() writefds 'not in use' case: closed/unallocated
  descriptors must be reported immediately as writable per BSD semantics.
  Several tests (netx_bsd_tcp_basic_blocking_test, _rcvbuf_test,
  _getaddrinfo_test) depend on this behaviour.

- Fix select() exceptfds race with readfds: the readfds scan calls
  nx_tcp_socket_receive() which dequeues the head packet; a subsequent
  peek at nx_tcp_socket_receive_queue_head in the exceptfds scan then
  finds NULL.  Move the URG/push-flag check into the readfds scan
  immediately after the successful dequeue while the packet is still
  accessible.

- Add regression test netx_bsd_select_improvements_test covering:
  * zero-timeout select clears all fdsets without blocking
  * normal TCP data sets readfds, not exceptfds
  * a not-in-use descriptor appears in writefds
  Register test in regression/CMakeLists.txt.

---------

Co-authored-by: Frédéric Desbiens &lt;frederic.desbiens@eclipse-foundation.org&gt;
Co-authored-by: Copilot &lt;223556219+Copilot@users.noreply.github.com&gt;</content>
</entry>
</feed>
