SDK's ard_socket.c bug in get_available()

Claude Opus5.5 found a bug :

My earlier fix for Serial commands put the SDK’s WiFiServer into non-blocking mode. That mode has a bug in get_available() (in the SDK’s ard_socket.c):

  1. loop() checks for an HTTP client every ~5 ms. When nobody is connecting, the low-level accept fails with “try again later”, which is normal for non-blocking mode.
  2. To read that reason, the SDK calls get_sock_errno(). For non-blocking sockets it always returns 0 instead of “try again later”.
  3. So get_available() treats a normal “no client yet” as a real failure and prints [ERROR] get_available Accept connection failed. That happens on every pass of loop(), hundreds of times a second.

You see it because the board menu setting Tools → Arduino: API logs defaults to Enable all. The SDK can only block the loop or spam this message; it has no quiet non-blocking option.

Hi @rkuo2000 ,

When a WiFiServer is created in NON_BLOCKING_MODE, the listening socket is set non-blocking. Your loop() calls server.available() every few ms. When no client is connecting at that instant, the low-level accept() returns “try again later” — that’s the expected result in non-blocking mode, not a failure.

Can you try changing the API logs option to Info logs?

Tools → Arduino: API logs → Info logs.

Thank you.