libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Writing response to socket?


From: Nicholas J Humfrey
Subject: [libmicrohttpd] Writing response to socket?
Date: Thu, 31 Dec 2009 12:25:11 +0000

Hello,

I am writing an RDF Triplestore[1] called Redstore[2] using the Redland[3] 
libraries.

The HTTP responses could end up being quite large, so I would like to try and 
stream the results, rather than storing it all in memory first, as I am at the 
moment.

Is there a way that I can write directly to the connection socket? I have 
looked at the callback methods and fileserver_example.c but I can't see how I 
can tie that into the Redland library API.

Here are the serializer functions available from Redland:
librdf_serializer_serialize_stream_to_file()
librdf_serializer_serialize_stream_to_file_handle()
librdf_serializer_serialize_stream_to_iostream()
librdf_serializer_serialize_stream_to_string()

I am currently using the 'to_string' method and then constructing the HTTP 
response. In order to use to_file_handle or to_iostream, there seems to be a 
bit of a control inversion problem. librdf wants to push the results to a 
socket and libmicrohttpd wants to pull the results.

Any suggestions?


Thanks,

nick.


[1] http://en.wikipedia.org/wiki/Triplestore
[2] http://code.google.com/p/redstore/
[3] http://www.librdf.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]