lib-bsd socket close issues

Matthew J Fletcher amimjf at
Thu Apr 4 15:47:34 UTC 2019


I have noticed an issue with lib-bsd that the legacy stack does not have.

If have a loop that does

for (;;)
  wait(100) // milliseconds
  socket() // allocate
  close() // free

then i can see the socket numbers allocated upwards, but eventually the get
ENOBUFS from socket(),.. allocating more sockets just delays the problem

It seems like this is some lazy freeing or complex system designed for high
loading systems to make close() faster, but on an embedded system its

is there some lib-bsd function that can force a 'flush' to prevent this ?


Matthew J Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list