Description
Description of defect
If a socket should be opened but the stack cant open it, there is no possibility to retry opening it later again. The stack is saved even if the socket cant be opened on the stack. Which lead to a problem because of the if statement on line 38. Another call on open is not possible because the stack is saved internally but cant be reset.
mbed-os/connectivity/netsocket/source/InternetSocket.cpp
Lines 34 to 49 in cecc47b
The close method does check if a socket is valid. If it is not, the stack is not removed from the InternetSocket.
mbed-os/connectivity/netsocket/source/InternetSocket.cpp
Lines 60 to 68 in cecc47b
Either the open method should remove the stack from the InternetSocket if the socket cant be opened, or the close method removes the stack from the InternetSocket even if the socket is not valid.
Target(s) affected by this defect ?
All.
Toolchain(s) (name and version) displaying this defect ?
All.
What version of Mbed-os are you using (tag or sha) ?
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
All.
How is this defect reproduced ?
Open as much sockets as available by the LWIPStack. Try open one extra socket. Close all other sockets. Try to open that extra socket again. Opening this socket wont be possible.