[network] cpp-netlib 0.7 ready to be released

Hi Guys, I just wanted to give everyone interested a heads up on the progress being made on the cpp-netlib project (which I'm working on full-time at the moment). Basically: * There's now an asynchronous/active HTTP client implementation that returns response objects that encapsulate futures. This uses the Boost.Asio asynchronous socket interfaces to implement reads/writes on the active object. * The documentation has been moved from Quickbook to ReStructuredText and generated with Sphinx (and they look really nice if I may say so myself: http://mikhailberis.github.com/cpp-netlib/). * The message concept has been fleshed out and now requires external modifiers. * Requirement for OpenSSL has been dropped, now by default doesn't support HTTPS unless specified. This impending 0.7 release also uses more template metaprogramming tools from Boost.MPL to implement the tag dispatch mechanism to modify behaviors of the classes based on these tags. Policies were introduced and are chosen depending on the characteristics of the tags provided. Development on 0.8 shall include: * A more feature-complete HTTP server template that supports a worker thread pool where handlers get invoked, and where handlers can write data to the connection asynchronously. * A streaming HTTP client interface to support passing a raw stream associated with a socket to a handler function or as part of the response object returned. * A preliminary XMPP client implementation. * The beginnings of a web service framework on top of the HTTP server to allow for a more web-framework like feel, similar to how web frameworks like Tornado Web (http://tornadoweb.org/) Target release of 0.8 will be the first week of November. The development of cpp-netlib targets an end-of-year submission to the Boost Library, and hopefully those interested in the project can go ahead and try it out now so that I and the other developers can work on feature requests before that time -- and so that early evaluations can guide the direction of the development before December. Thanks everyone and I look forward to hearing from you! Note: You can find the documentation for cpp-netlib (which I presented at BoostCon 2010) at http://mikhailberis.github.com/cpp-netlib -- Dean Michael Berris deanberris.com

At Thu, 14 Oct 2010 23:15:57 +0800, Dean Michael Berris wrote:
Hi Guys,
I just wanted to give everyone interested a heads up on the progress being made on the cpp-netlib project (which I'm working on full-time at the moment).
Awesome! Is someone funding that?
Basically:
* There's now an asynchronous/active HTTP client implementation that returns response objects that encapsulate futures. This uses the Boost.Asio asynchronous socket interfaces to implement reads/writes on the active object. * The documentation has been moved from Quickbook to ReStructuredText and generated with Sphinx (and they look really nice if I may say so myself: http://mikhailberis.github.com/cpp-netlib/).
They do! Having not had very much experience with Quickbook, I would be very curious as to what prompted the switch. I also think you should know that there's a slightly-crude-but-very-effective literate programming system for ReST in Boost, under boost/tools/litre/. You can see it in use for the Boost.Parameter library. We also used that to check all the code in the C++TMP book.
This impending 0.7 release also uses more template metaprogramming tools from Boost.MPL to implement the tag dispatch mechanism to modify behaviors of the classes based on these tags.
Does that show up in the library's interface?
Policies were introduced and are chosen depending on the characteristics of the tags provided.
Development on 0.8 shall include:
* A more feature-complete HTTP server template that supports a worker thread pool where handlers get invoked, and where handlers can write data to the connection asynchronously. * A streaming HTTP client interface to support passing a raw stream associated with a socket to a handler function or as part of the response object returned. * A preliminary XMPP client implementation. * The beginnings of a web service framework on top of the HTTP server to allow for a more web-framework like feel, similar to how web frameworks like Tornado Web (http://tornadoweb.org/)
Target release of 0.8 will be the first week of November.
The development of cpp-netlib targets an end-of-year submission to the Boost Library, and hopefully those interested in the project can go ahead and try it out now so that I and the other developers can work on feature requests before that time -- and so that early evaluations can guide the direction of the development before December.
Thanks everyone and I look forward to hearing from you!
Note: You can find the documentation for cpp-netlib (which I presented at BoostCon 2010) at http://mikhailberis.github.com/cpp-netlib
Having something like this in Boost is long overdue, so I'm really looking forward to the results! -- Dave Abrahams BoostPro Computing http://www.boostpro.com

On Fri, Oct 15, 2010 at 10:32 PM, David Abrahams <dave@boostpro.com> wrote:
At Thu, 14 Oct 2010 23:15:57 +0800, Dean Michael Berris wrote:
Hi Guys,
I just wanted to give everyone interested a heads up on the progress being made on the cpp-netlib project (which I'm working on full-time at the moment).
Awesome! Is someone funding that?
Thanks! :) Nobody is funding this effort now, I'm in between jobs as I type. :D
* The documentation has been moved from Quickbook to ReStructuredText and generated with Sphinx (and they look really nice if I may say so myself: http://mikhailberis.github.com/cpp-netlib/).
They do! Having not had very much experience with Quickbook, I would be very curious as to what prompted the switch.
Well, not to knock too much on Quickbook, but here are some reasons: 1. Lack of syntax highlighting support on major editors. I use ViM almost exclusively to edit the C++ and the documentation, and it's really hard to work on Quickbook docs without the visual cues for instant gratification. Of course it's just a matter of writing the syntax files, but... 2. Because of the syntax, it's really hard to write the syntax descriptions. I think a real EBNF grammar would work, but regex and the syntax files don't do so well. I've tried and gave up multiple times in this regard, having contributed syntax highlighting for Kate a loooong time ago. I think it's as much a problem with ViM as it is with the (nice, but unique) syntax of quickbook documents. 3. The toolchain is really pretty obscure. If you want to get anywhere near changing the layout you're going to have to learn XSLT which is so far removed from HTML that it's discouraging. Then there's FOP for the PDF, there's BoostBook which are the extension to DocBook, and ... well, compared to RST which is very well supported by just the docutils package in Python, there's just much less intellectual and toolchain baggage to deal with. 4. RST looks good stand-alone. Quickbook is a lot like a markup language, and the documentation tends to look like a program of sorts. Sure there's automatic indentation, automatic paragraphs, blurb support, the works... but when you read an RST document, you don't need it rendered to get the visual cues as to what the structure of the document is like. So I guess I did knock on Quickbook quite a bit. :D
I also think you should know that there's a slightly-crude-but-very-effective literate programming system for ReST in Boost, under boost/tools/litre/. You can see it in use for the Boost.Parameter library. We also used that to check all the code in the C++TMP book.
Ooooooh, nice! I'll definitely check this out, thanks for the pointer Dave!
This impending 0.7 release also uses more template metaprogramming tools from Boost.MPL to implement the tag dispatch mechanism to modify behaviors of the classes based on these tags.
Does that show up in the library's interface?
Not one bit. :) The tag dispatch mechanism is an internal mechanism used by the library, similar to how Fusion uses tag dispatch for customization and extension. In cpp-netlib though, this is everywhere except in the user interface. Without looking at the internals of cpp-netlib, users shouldn't care whether it uses Boost.MPL. It actually didn't for a while until 0.7, which is going to come out real soon now. :)
The development of cpp-netlib targets an end-of-year submission to the Boost Library, and hopefully those interested in the project can go ahead and try it out now so that I and the other developers can work on feature requests before that time -- and so that early evaluations can guide the direction of the development before December.
Thanks everyone and I look forward to hearing from you!
Note: You can find the documentation for cpp-netlib (which I presented at BoostCon 2010) at http://mikhailberis.github.com/cpp-netlib
Having something like this in Boost is long overdue, so I'm really looking forward to the results!
Cool, thanks Dave. I'll keep everyone updated as I make progress. :) -- Dean Michael Berris deanberris.com

On Fri, Oct 15, 2010 at 2:02 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
On Fri, Oct 15, 2010 at 10:32 PM, David Abrahams <dave@boostpro.com> wrote:
At Thu, 14 Oct 2010 23:15:57 +0800, Dean Michael Berris wrote:
Hi Guys,
I just wanted to give everyone interested a heads up on the progress being made on the cpp-netlib project (which I'm working on full-time at the moment).
Awesome! Is someone funding that?
Thanks! :)
Nobody is funding this effort now, I'm in between jobs as I type. :D
* The documentation has been moved from Quickbook to ReStructuredText and generated with Sphinx (and they look really nice if I may say so myself: http://mikhailberis.github.com/cpp-netlib/).
They do! Having not had very much experience with Quickbook, I would be very curious as to what prompted the switch.
Well, not to knock too much on Quickbook, but here are some reasons:
1. Lack of syntax highlighting support on major editors. I use ViM almost exclusively to edit the C++ and the documentation, and it's really hard to work on Quickbook docs without the visual cues for instant gratification. Of course it's just a matter of writing the syntax files, but...
2. Because of the syntax, it's really hard to write the syntax descriptions. I think a real EBNF grammar would work, but regex and the syntax files don't do so well. I've tried and gave up multiple times in this regard, having contributed syntax highlighting for Kate a loooong time ago. I think it's as much a problem with ViM as it is with the (nice, but unique) syntax of quickbook documents.
3. The toolchain is really pretty obscure. If you want to get anywhere near changing the layout you're going to have to learn XSLT which is so far removed from HTML that it's discouraging. Then there's FOP for the PDF, there's BoostBook which are the extension to DocBook, and ... well, compared to RST which is very well supported by just the docutils package in Python, there's just much less intellectual and toolchain baggage to deal with.
4. RST looks good stand-alone. Quickbook is a lot like a markup language, and the documentation tends to look like a program of sorts. Sure there's automatic indentation, automatic paragraphs, blurb support, the works... but when you read an RST document, you don't need it rendered to get the visual cues as to what the structure of the document is like.
So I guess I did knock on Quickbook quite a bit. :D
I also think you should know that there's a slightly-crude-but-very-effective literate programming system for ReST in Boost, under boost/tools/litre/. You can see it in use for the Boost.Parameter library. We also used that to check all the code in the C++TMP book.
Ooooooh, nice! I'll definitely check this out, thanks for the pointer Dave!
This impending 0.7 release also uses more template metaprogramming tools from Boost.MPL to implement the tag dispatch mechanism to modify behaviors of the classes based on these tags.
Does that show up in the library's interface?
Not one bit. :)
The tag dispatch mechanism is an internal mechanism used by the library, similar to how Fusion uses tag dispatch for customization and extension. In cpp-netlib though, this is everywhere except in the user interface.
Without looking at the internals of cpp-netlib, users shouldn't care whether it uses Boost.MPL. It actually didn't for a while until 0.7, which is going to come out real soon now. :)
The development of cpp-netlib targets an end-of-year submission to the Boost Library, and hopefully those interested in the project can go ahead and try it out now so that I and the other developers can work on feature requests before that time -- and so that early evaluations can guide the direction of the development before December.
Thanks everyone and I look forward to hearing from you!
Note: You can find the documentation for cpp-netlib (which I presented at BoostCon 2010) at http://mikhailberis.github.com/cpp-netlib
Having something like this in Boost is long overdue, so I'm really looking forward to the results!
Cool, thanks Dave. I'll keep everyone updated as I make progress. :)
I am quite interested in this as well, but I do have three questions. Currently I use Wt C++ Web Toolkit for a little web interface into a server of mine, but I would love to drop it due to its extremely nasty GPL license (so I could then freely give away my code, GPL is *SO* restrictive..), I mainly use it for three reasons (as I had written a mini-http server in the past and used that, but this functionality is just *so* useful and irritating enough to write that I did not want to add it to mine), and from looking in the docs I do not see this functionality in there. First, keeping a socket open. Just based on what I see in the docs and examples (which is no doubt incomplete right now anyway, but I need to know), it does not seem possible to keep a socket open, such as what I use that for is I send a webpage to a client, but I keep it open using http chunked encoding and I send javascript bits as updates, which the browser then runs to update the page, so I send real-time updates without any need for polling, Wt makes this aspect quite literally brainless (do whatever work you need to in a thread, when you need to update some views, grab the lock for a Wt Application session, update the session, release the lock, which then ripples the changes to the page in real-time + ping-time, can also just do something basic like render part of a page while you do more processing and just send more of it as processing completes to give progress updates). Second, WebSocket/etc... support, this is dependent on the above, need to keep a socket open, you can 'emulate' it with polling, but that can cause delayed data, it can cause too much data to be sent when there are no updates needed, etc... As stated, I use this type of functionality to send real-time updates of the server and what is happening to the webpage, and there are a lot of updates (and thanks to how Wt works, it only sends updates to things that are visible, vastly reduces data transmission usage). Third, I am a programmer, hence I am lazy, I do not want to write a crap-ton of HTML and Javascript (my main reason for moving to Wt from my own HTTP built-in server). Will there be an interface built on top of cpp-netlib to simplify that? For example I can write a webpage in Wt using an interface that is pretty identical to Qt, feels just like writing a GUI, something I am familiar with and it keeps me nicely in the domain to which I am accustomed (C++). I can of course drop out to sending html (or html chunks) and/or javascript things (of which I can nicely integrate into a C++ callback on the server side). I can setup a Wt 'gui', of which I can stuff my data and server information in to as updates occur (sometimes very rapidly, sometimes not), and it just works in every browser, whether javascript is enabled or not (although if not it falls back to http polling so is a bit slower, but still works). Understandably this one may be beyond the scope of cpp-netlib as-is, but it still needs to be possible to implement such a thing on it, and perhaps be included with it later on. Basically what I would use this for in the immediate future is to put as a simple html interface to a server of mine, using a license that actually lets me distribute it, without me needing to rewrite some of the more complicated internals of Wt elsewhere.

On Sat, Oct 16, 2010 at 7:41 AM, OvermindDL1 <overminddl1@gmail.com> wrote:
On Fri, Oct 15, 2010 at 2:02 PM, Dean Michael Berris <mikhailberis@gmail.com> wrote:
I am quite interested in this as well, but I do have three questions.
Cool. :)
Currently I use Wt C++ Web Toolkit for a little web interface into a server of mine, but I would love to drop it due to its extremely nasty GPL license (so I could then freely give away my code, GPL is *SO* restrictive..), I mainly use it for three reasons (as I had written a mini-http server in the past and used that, but this functionality is just *so* useful and irritating enough to write that I did not want to add it to mine), and from looking in the docs I do not see this functionality in there.
First, keeping a socket open. Just based on what I see in the docs and examples (which is no doubt incomplete right now anyway, but I need to know), it does not seem possible to keep a socket open, such as what I use that for is I send a webpage to a client, but I keep it open using http chunked encoding and I send javascript bits as updates, which the browser then runs to update the page, so I send real-time updates without any need for polling, Wt makes this aspect quite literally brainless (do whatever work you need to in a thread, when you need to update some views, grab the lock for a Wt Application session, update the session, release the lock, which then ripples the changes to the page in real-time + ping-time, can also just do something basic like render part of a page while you do more processing and just send more of it as processing completes to give progress updates).
With the coming 0.7 release, this is not yet possible (keeping the socket open). However, the 0.8 version will address these and much more issues with the server implementation. One of the things that needs to be addressed from the server end is how to effectively do chunked transfer encoding transparently. This is going to be a standalone component, yes, but it will have to be integrated with how an HTTP Connection is implemented in cpp-netlib so will be intimately tied to how that happens.
Second, WebSocket/etc... support, this is dependent on the above, need to keep a socket open, you can 'emulate' it with polling, but that can cause delayed data, it can cause too much data to be sent when there are no updates needed, etc... As stated, I use this type of functionality to send real-time updates of the server and what is happening to the webpage, and there are a lot of updates (and thanks to how Wt works, it only sends updates to things that are visible, vastly reduces data transmission usage).
I've been contemplating on making this part of cpp-netlib, but I have yet to feel good enough about the specifications of WebSocket to implement it in cpp-netlib. It should be trivial to write a handler that supports the HTTP->WebSocket upgrade, but that -- like the chunked transfer encoding -- will have to be a separate component that would (no doubt) be documented properly, once it's there. :)
Third, I am a programmer, hence I am lazy, I do not want to write a crap-ton of HTML and Javascript (my main reason for moving to Wt from my own HTTP built-in server). Will there be an interface built on top of cpp-netlib to simplify that? For example I can write a webpage in Wt using an interface that is pretty identical to Qt, feels just like writing a GUI, something I am familiar with and it keeps me nicely in the domain to which I am accustomed (C++). I can of course drop out to sending html (or html chunks) and/or javascript things (of which I can nicely integrate into a C++ callback on the server side). I can setup a Wt 'gui', of which I can stuff my data and server information in to as updates occur (sometimes very rapidly, sometimes not), and it just works in every browser, whether javascript is enabled or not (although if not it falls back to http polling so is a bit slower, but still works). Understandably this one may be beyond the scope of cpp-netlib as-is, but it still needs to be possible to implement such a thing on it, and perhaps be included with it later on.
Actually, I'm more than comfortable to create a separate library (included in cpp-netlib) that does a web template system using Boost.Spirit's Qi+Karma, to support Django templates. The idea is it should be possible to create a function object from a template file, pass it a map of variants as input, which then either yields a string, or does the rendering to the socket given a reference to a connection. This will be dynamic though, meaning it's going to be somewhat of an HTML/Text template compiler that creates a function object at runtime. The function object might be able to do more things than just that, but it should nonetheless be enough. :) That said, you're right -- it might not be part of the core of cpp-netlib, but having a library for rendering in a web/ directory would be nice.
Basically what I would use this for in the immediate future is to put as a simple html interface to a server of mine, using a license that actually lets me distribute it, without me needing to rewrite some of the more complicated internals of Wt elsewhere.
Cool, would definitely love feedback as the library progresses. :) Thanks for the questions, I hope these answers help. -- Dean Michael Berris deanberris.com

On 16/10/2010 3.08, Dean Michael Berris:
Actually, I'm more than comfortable to create a separate library (included in cpp-netlib) that does a web template system using Boost.Spirit's Qi+Karma, to support Django templates. The idea is it should be possible to create a function object from a template file, pass it a map of variants as input, which then either yields a string, or does the rendering to the socket given a reference to a connection.
That would be a w e s o m e. Keep up the good work. Stefano

On Mon, Oct 18, 2010 at 4:41 PM, Stefano Delli Ponti <stefano.delliponti@gmail.com> wrote:
On 16/10/2010 3.08, Dean Michael Berris:
Actually, I'm more than comfortable to create a separate library (included in cpp-netlib) that does a web template system using Boost.Spirit's Qi+Karma, to support Django templates. The idea is it should be possible to create a function object from a template file, pass it a map of variants as input, which then either yields a string, or does the rendering to the socket given a reference to a connection.
That would be a w e s o m e.
I'm glad you think so too. :D
Keep up the good work.
Thanks! :) -- Dean Michael Berris deanberris.com
participants (5)
-
David Abrahams
-
Dean Michael Berris
-
Jeroen Habraken
-
OvermindDL1
-
Stefano Delli Ponti