Re: SoupSessionAsync with ostream





2012/1/2 Kaiser . <yahyai-0 hotmail com>
Hello

I wanted to use Libsoup to download some files from Internet ... Asynchronously ,
can I get some help? and can you explain to me how callback function works?

here what I have tried

{
SoupSession *session;
    SoupMessage *msg;
    guint status;
   
    session = soup_session_async_new();
    msg = soup_message_new (SOUP_METHOD_GET, url);
      // send the HTTP request
    status = soup_session_send_message (session ,msg);
Can you try commenting the call to soup_session_send_message() ? This function will cause the message to be send synchronously and the response will be retrieved by your program at the moment. It will NOT be done asynchronously.

After this call the message will be already downloaded thus making the call to soup_session_queue_message() redundant.

I don't know what's the behavior of libsoup when a same message is sent twice. Perhaps this could explain why you don't get the expected results in your callback.

-- 
Emmanuel Rodriguez


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]