Receiving Error Domain=kCFErrorDomainCFNetwork Code=2 when attempting to read from ReadStream

后端 未结 3 1007
忘了有多久
忘了有多久 2021-01-17 11:37

I\'m attempting to synchronously read from a CFReadStream objected created by CFStreamCreatePairWithSocketToHost. The stream opened fine but when I

3条回答
  •  误落风尘
    2021-01-17 12:24

    I was able to fix this by putting in Google's DNS servers (8.8.8.8,8.8.4.4) in the wifi connection in the Settings app. The issue was that our devices were on a network that first required you to agree to some terms of service on a proxy login web page, much like hotels and coffee shops do. Safari worked fine after agreeing, but the app didn't, even after agreeing in Safari. Switching to alternate DNS worked (so did putting in the IP address instead of the DNS entry of our server, but I didn't want to hard-code an IP address).

提交回复
热议问题