开发者

NSStreamEventErrorOccurred message arrives too late

We are developing a client-server application. The client (iPhone application) and server (desktop) communicate via wi-fi. We are using TCP/IP.

Each five seconds the client application sends a special message to the server (we call it a ping, but it's our ping). We have to test the client's behaviour when the connection with the server breaks. I turn of wi-fi on my desktop. We expect to receive a notification that the link is broken afte开发者_运维问答r a small period of time. Instead, the notification arrives after 4 or 5 minutes (the client is using NSStream class, so it says "NSStreamEventErrorOccurred").

  1. Why it arrives so late?

  2. How can I get a notification sooner? (say, in 5 seconds)

Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜