Re: [Cppcms-users] (no subject)
Brought to you by:
artyom-beilis
From: eric m. <mid...@gm...> - 2014-02-20 18:25:18
|
Hi Marcel, Thank you for your reaction. I have well over 25 years experience with programming in c, c++, c# and Ruby, but have virtually no experience with web-development. I do understand the concepts but am struggling to get a working comet-example to use. See my comments underneath at the ### marks. Hope you can help me out here. Kind regards, Eric On Thu, Feb 20, 2014 at 1:12 PM, Marcel Hellwig <ke...@co...> wrote: > > > On 20.02.2014 05:12, eric middelkoop wrote: > > Hello, > > > > I am looking for a way to update parts of a webpage via events from the > > server. > > > > I downloaded the Ticker example from the blog but as I try to compile it > > (os = Ubuntu) I'm getting the following errors: > which version of gcc do you using? > ###4.7.3 > g++ -std=c++0x -O2 -Wall -g ticker.cpp -o ticker -lcppcms -lbooster > > ticker.cpp: In member function 'void > > ticker::async_send(booster::shared_ptr<cppcms::http::context>)': > > ticker.cpp:83:39: error: capture of non-variable 'ticker::counter_' > > ticker.cpp:97:9: note: 'int ticker::counter_' declared here > fun fact: ticker.cpp has only 76 lines :) > Which version of the ticker are you using? The latest from svn trunk? > ###The first one that gives the compiler error I got from here: http://cppcms.com/files/ticker/ ###The other one that does compile but reacts like described underneath I got from here ### https://svn.code.sf.net/p/cppcms/code/framework/trunk/contrib/server_side/sse/ > > > I also downloaded the Sse Ticker example from contrib and that does > > compile but when I run it and access the page from firefox > > (127.0.0.1:8080/ticker <http://127.0.0.1:8080/ticker>), I get a 404 Not > > Found and a popup with the following information: > hmm. I think you mess up things. 404 really means nothing, but firefox > has a file which will be presented to you. > > > > ------------------------------------------------------- > > ticker > > which is: text/event-stream > > from: http://127.0.0.1:8080 > > > > What should firefox do with this file? > > - Open with Browse > > - Save File > > -------------------------------------------------------- > > > > It doesn't display the tickers on the webpage. > Yep, that's right, but that's what the ticker does. It does not have a > page to display, but emits events the whole time to a stream. To view > the content you can use this: > > > wget localhost:8080/ticker -qO - | cat > ###Ok I understand this. But the page does contain the following: <p>Price:<span id="price"></span></p> so I had expect it to show something. If that's not doing it, how can I translate that stream into a field that is updated and displayed on every change? > > > > > I have a camera that is shooting photographs and want a webpage to > > reflect what the camera is doing. So every time it shoots a photograph > > the webserver should send the filename and sequencenumber of that > > photograph to the webpage and the user must be able to inform the camera > > to stop taking pictures via pressing a button. > You need a webpage that does some magic javascript and a backend. That > shouldn't be that hard. > > So HTTP requests to > > control the camera and asynchronous status-updates to be displayed on > > the webpage. > > > > I hope someone can help me out by either getting one of the ticker > > examples working or providing another working example. > > As I said. Everything works in the way that it should be. Maybe the chat > example is more for you :) > > > > Many thanks! > > > > Eric > > > > > Greetings > Marcel > > > > > ------------------------------------------------------------------------------ > Managing the Performance of Cloud-Based Applications > Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. > Read the Whitepaper. > > http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- Groetjes, Eric http://www.lightandmagicphotography.nl http://www.lightandmagicphotography.com |