On 29. des. 2013 10:06, Olaf Radicke wrote:
> ...on this site:
> http://www.tntnet.org/howto/static-howto.html
>
>
> greetings,
>
> Olaf
> (munich, germany)

Hello Olaf & thank you so much for replying!

I had actually read that page and looked at that code, but I could not 
make the connection that it was an answer to my question. Maybe it is a 
question of nomenclature, but I could not imagine that the page talking 
about "*Static* files with Tntnet" was actually the way to provide 
*dynamic* output...

I don't have a problem with C++, but the challenge is rather 
understanding how the "glue" between the web server and client works, 
i.e. how to obtain input and provide different kinds of run-time 
responses (text, images, ... etc.). That is where I feel uncertain right 
now.

A thing with the code you refer to, is that it really makes no sense at 
all to a reader who does not already know Tntnet. For example, in the 
code you showed there are variables called "request" and "reply", but 
there is no indication of their type. So the uninitiated reader is 
simply left wondering what it means. There is a reference to an include 
<tnt/mimedb.h>, http://www.tntnet.org/apidoc/html/mimedb_8h_source.html
but that does not offer any clues wrt. "request" and "reply" either. I 
searched the source code for "setContentType(" to see if I could figure 
out what "reply" was supposed to represent. From that search it looks 
like "reply is a "HttpReply" and probably request is a "HttpRequest" ? 
If this is so, I suggest adding some comments to the example, explaining 
this, and what their roles are. It is proably obvious to you, but it 
isn't obvious to me.

I looked up HttpReply in the API doc at
http://www.tntnet.org/apidoc/html/classtnt_1_1_http_request.html
and found that there is a setContentType member function, but there are 
no comments associated with that or any of the other member functions. 
This makes it hard for a beginner like myself. Since you are already 
using doxygen to generate the documentation, I would suggest adding 
doxygen-style comments to most member functions in the headers. I can 
see you are discussing in this group why Tntnet isn't used more, and I 
suspect it is partly because the documentation is somewhat terse beyond 
the quick start guide level (that part is really excellent, though!).

Ok, don't be discouraged by these comments, they are meant to be 
constructive in how Tntnet can be made more easily accessible to a 
beginner like me.

I am not giving up, though :-) . Now that you have pointed me towards 
the "Static files with Tntnet" page, I am looking at it again, with new 
eyes. Perhaps the section on "Using static@tntnet" is the simplest 
answer in my case?, i.e.

<mapping>
   <url>^/(.*)</url>
   <target>static@tntnet</target>
   <pathinfo>/var/www/htdocs/$1</pathinfo>
</mapping>

The way I am "understanding" this now is that my C++ code can generate a 
file called for example "graph.jpg" in the folder /var/www/htdocs/ and 
then that will be somehow picked up and displayed in the browser? If I 
generate the file with different contents at different times, it will be 
refreshed automatically? I shall give it a try.

Best regards
Carsten Arnholm




------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to