Packets dropped during chunked HTTP 1.1 request sent by NSURLConnection

冷暖自知 提交于 2019-12-11 05:23:16

问题


I am using the following code to set up a chunked HTTP 1.1 request (the request itself is a SOAP one but I don't think this is particularly important):

            NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
            ...
            NSInputStream *dataStream = [NSInputStream inputStreamWithFileAtPath:_tempFilePath];
            [request setHTTPBodyStream:dataStream];
            self.p_connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];

This seems to work fine except when request gets too big, I can see that some packets get randomly dropped in WireShark - it flags it as "TCP Previous segment not captured". I think the size of the request only matters insomuch as the random dropping of the packets has more chance to happen, but that otherwise it is some more fundamental issue.

Does anybody have an idea what might be at play here? Is it the fault of NSURLConnection or the way I am using it?

来源:https://stackoverflow.com/questions/15300788/packets-dropped-during-chunked-http-1-1-request-sent-by-nsurlconnection

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