curl-library
How can I make a second header request to the server?
Date: Wed, 27 Jun 2007 10:53:16 +0800
Hi
I want to play a media file by streaming, and it was successfully.
Now I want to add a fast forward call by send a header request to the server,
and then server will send the n seconds later data to me.
My question is how can I send the header request to the server
when the first curl_easy_perform is executing?
(assume the header request is look like ¡K..jump n seconds)
Thank you!!!
Here is my code
main()
{
mCurl = curl_easy_init();
curl_easy_setopt(mCurl , CURLOPT_PORT, 12345);
curl_easy_setopt(mCurl ,
CURLOPT_URL, "http://xxx.xxx.xxx.xxx/abc.mpg"
curl_easy_setopt(mCurl , CURLOPT_HTTPGET, TRUE);
curl_easy_setopt(mCurl , CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_1_1);
curl_easy_setopt(mCurl , CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(mCurl , CURLOPT_HEADERFUNCTION, MyHeaderCallback);
curl_easy_setopt(mCurl , CURLOPT_WRITEFUNCTION, MyBodyCallback);
curl_easy_setopt(mCurl ,CURLOPT_VERBOSE,1);
curl_easy_setopt(mCurl ,CURLOPT_DEBUGFUNCTION, MyInfoCallback);
ThreadHandle = CreateThread(NULL,0,ThreadProc,mCurl,0,&ThreadId);
while(1)
{
Read buffer;
Play the media file;
}
}
DWORD WINAPI ThreadProc (PVOID pParam)
{
curl_easy_setopt(CHandle, CURLOPT_ERRORBUFFER, ERRORBUFFER);
curl_easy_perform (CHandle);
curl_easy_cleanup(CHandle);
return 0;
}
size_t MyBodyCallback(BYTE *ptr, size_t size, size_t nmemb, void *stream)
{
Write Buffer(ptr);
return size * nmemb;
}
-- CHU CSIE WebMail (http://webmail.csie.chu.edu.tw/)Received on 2007-06-27