Posts

Post not yet marked as solved
9 Replies
4.5k Views
Hi!The Networking Overview state that I should avoid POSIX sockets on iOS because it doesn't activate the cellular modem. At the same time it states that the "most appropriate times to use sockets directly are when you are developing a cross-platform tool ..."I'm implementing a cross-platform library with a dependency on a third party MQTT-library that uses POSIX socket API (for TCP) , so for me there is a huge win in leveraging the POSIX APIs.Is there any way to "manually" keep the cellular modem active when needed? Technically I guess I could just send some random data with a high level API to keep it active, the feels more like a hack. What is the right way to solve this issue?Regards,Markus
Posted Last updated
.
Post not yet marked as solved
2 Replies
414 Views
Hi! I noticed that responses with Content-Length = 0 are not stored in the URLCache, while responses with Content-Length 0 are stored. In my case the response contains a Protobuf message where all fields might have default values. This message will have size 0 when encoded and is a valid message. I would expect this message to be cached as all other instances of the message type. Is there a reason why 0-sized response are not stored in cache? Or is it a bug? Best Regards Markus Steps to reproduce: This response will cause URLCache.storeCachedResponse(_, for) to be called: HTTP/1.0 200 OK Content-Type: application/protobuf Content-Length: 1 Cache-Control: max-age=20 This response will not cause any call to URLCache.storeCachedResponse(_, for): HTTP/1.0 200 OK Content-Type: application/protobuf Content-Length: 0 Cache-Control: max-age=20
Posted Last updated
.