如何使用AFNetworking库与服务器建立HTTP持久连接

时间:2013-12-02 11:14:39

标签: ios http keep-alive afnetworking-2

任何人都可以指出我使用AFNetworking库与服务器进行HTTP持久连接的正确方向。我已经查看了以下代码:

NSURL *URL = [NSURL URLWithString:@"http://example.com"];
AFRocketClient *client = [[AFRocketClient alloc] init];
[client SUBSCRIBE:@"/resources" usingBlock:^(NSArray *operations, NSError *error) {
for (AFJSONPatchOperation *operation in operations) {
    switch (operation.type) {
        case AFJSONAddOperationType:
            [resources addObject:operation.value];
            break;
        default:
            break;
    }
}
} error:nil];

来自https://github.com/AFNetworking/AFRocketClient

我觉得这不是自我解释???

0 个答案:

没有答案