如何使服务器使用AFNetworking库中的HTTP持久连接(How to make a HTTP

2019-10-19 02:05发布

任何人都可以请点我朝着正确的方向在制作使用服务器的HTTP持久连接AFNetworking库。 我已经看了看下面的代码:

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

这我觉得是不言自明???

文章来源: How to make a HTTP persistent connection with server using AFNetworking library