How to make a HTTP persistent connection with server using AFNetworking library

岁酱吖の 提交于 2019-12-11 07:24:52

问题


Can anyone please point me in the right direction in making a HTTP persistent connection with server using AFNetworking library. I've already looked at the following code:

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];

from https://github.com/AFNetworking/AFRocketClient

Which I felt is not self explanatory???

来源:https://stackoverflow.com/questions/20326936/how-to-make-a-http-persistent-connection-with-server-using-afnetworking-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!