How to cancel a persistent connection using NSURLConnection?

后端 未结 3 1011
星月不相逢
星月不相逢 2020-12-28 17:12

Is it possible to destroy a persistent connection that has been created with NSURLConnection? I need to be able to destroy the persistent connection and do another SSL hand

3条回答
  •  忘掉有多难
    2020-12-28 17:38

    First, you should use [self.conn cancel] and second, that does just what it says. It cancels itself. If you don't want to use an NSURLConnection after that anymore, it won't do anything and if you'll use it again, you can just set a different request, which will connect to the given server.

    Hope that helps.

提交回复
热议问题