• It'd be worth looking at how the existing ESP8266 library handles it because that has exactly the same issues and still works fine.

    Did you see the inline documentation in network.h?

    • for connect it's expected to block - but it doesn't matter too much if it doesn't since the actual HTTP callback won't be called until a header is received. The only case it'd really matter is in a standard (non-HTTP) connect call. If it turns out the connect has failed then send/recv can just return -1 when they're next called and everything will get cleaned up nicely.
    • send/recv just return 0 if they can't return/take any data.

    So it really shouldn't be very painful to make it work, with the minor issue that a simple TCP connect that fails will still call the connected callback. IMO that's something that you should look at doing after you've got working networking though.

About

Avatar for Gordon @Gordon started