I am using an Nucleo STM32F767ZI with MBED OS 6.9.0, and I am running into issues with TCPSocket::connect() reporting -3004 (NSAPI_ERROR_NO_CONNECTION) error which is “not connected to a network.” This is despite the fact that “network.connect()” and “client.open(&network)” all report no error. (see code below).
I am checking if errors occur at each stage of the process which are all reporting that there are no issues. If I run the ST as a server (i.e. bind, accept, etc… are all working as expected), I can use my computer to send/recv information from the ST without issue. I only run into problems when trying to run the ST as a client.
When the code gets to “client.connect(server_address)” it hangs for a few seconds and reports the error.
I am using PlatformIO, but I also tried MBED Studio with MBED OS 6.17.0 and the behavior is the same. Am I doing anything wrong, or is there possibly a bug I don’t know about? Any insight would be much appreciated.
Thank you for taking the time to run a test. Your recommendation to look at the PC side was the trick. It was a firewall setting preventing inbound connections.