I have a webserver developed from scratch in Microsoft visual c ++ 2019. I use only c/c++, when I receive the request, I process it and build a response that I send to the client. I use my iPhone (13 pro with iOS 15.2).
Case 1: I am connected to a local wi-fi, I type the server address (local address or external address by port forwarding), it receives 'get / http ...' and 'get / other resources' through 3-4 simultaneous connections and responds with the content of the requested page. The connections remain stable and I can navigate further through the site, opening other pages without any problems. iPhone send requests and my server respond. everything works fine.
Case 2: I am connected only to the telephone operator (4G Vodafone), I type the external server address, it receives 'get / http ...' and 'get / other resources' through 3-4 simultaneous connections and responds with the content of the requested page. (just once, only first page). After that, the connections disappear and I can no longer browse the site (because I lose the session ID and other credentials). **In fact, the iPhone, after receiving what it requested, sends many null buffers and my server disconnects all sockets immediately. is something to do with WSAENOBUF, but I don't know what. **
Why this dual behavior. How can I solve this situation?
Thank you very much.