0
votes

in ASIHTTPRequest class

I debug - (void)main method of the NSOperation with wireshark . I want to find which method send data.

But i debug to the end of startRequest in main method of NSOperation. I can't grab any data.

Because the read stream opens a socket connection with the server specified by the myUrl parameter when the CFHTTP request was created, some amount of time must be allowed to pass before the stream is considered to be open. Opening the read stream also causes the request to be serialized and sent.

base the above document of apple about "Communicating with HTTP Servers"

the most chance to send data is the below code .But it don't. I can't find something in wireShark.

CFStreamClientContext ctxt = {0, self, NULL, NULL, NULL};
if (CFReadStreamSetClient((CFReadStreamRef)[self readStream], kNetworkEvents, ReadStreamClientCallBack, &ctxt)) {
    if (CFReadStreamOpen((CFReadStreamRef)[self readStream])) {
        streamSuccessfullyOpened = YES;
    }
}

where send data ???? like socket send or sendto function.

1

1 Answers

0
votes

ASIHTTPRequest is built on top of CFNetwork's HTTP abstraction (see CFHTTPMessageCreateRequest and so on), so it never directly calls 'send' on a socket.

ASIHTTPRequest "sends" data by telling CFHTTP to send it - eg. CFHTTPMessageSetHeaderFieldValue.