GCDAsyncUdpSocket 发送广播包时,出现Error receiving:error code = 1

使用GCDAsyncUdpSocket,绑定IP,端口号,组播IP后,一切正常运行,真机调试,出现下面的错误。

Error receiving: Error Domain=GCDAsyncUdpSocketErrorDomain Code=1 "Must bind socket before you can receive data. You can do this explicitly via bind, or implicitly via connect or by sending data." UserInfo={NSLocalizedDescription=Must bind socket before you can receive data. You can do this explicitly via bind, or implicitly via connect or by sending data.}


检查之后发现是手机不在内网,所以会出现这个错误。

你可能感兴趣的:(iOS开发)