Hi all I did the following to get data to push to the web page:
Scenario: An RFID tag is read and processed by an ALE server. The ALE server then sends the data to my Catalyst URL: http://x.x.x.x:3000/ale/notifier?tagdata The ale/notifier action then extracts the tag id from the variable and then does a lookup in a database to get the data associated to the tag. It then puts the tag data in a queue and the last action is to make a socket connection, as a client, to a socket server running inside the /assettracker/display_tagdata action. The following code is an extract from the ale/notifier: sub notify_tag_read { use IO::Socket::INET; my $MySocket=new IO::Socket::INET->new(PeerPort=>26482,Proto=>'udp',PeerAddr=>'x.x.x.x'); my $msg = ""; $MySocket->send($msg); } When I access, via a browser, the url http://x.x.x.x:3000/assettracker/display_tagdata it loads a socket server and waits for a connection from a client. The following is a snippet of the /assettracker/display_tagdata action: sub display_tagdata : Local { my ( $self, $c ) = @_; my $text; my @args; $c->stash->{template} = 'sockettest.tt2'; use IO::Socket::INET; my $MySocket=new IO::Socket::INET->new(LocalPort=>26482,Proto=>'udp',Reuse=>1); $MySocket->recv($text,128); @args = [$text]; $c->forward('get_tagdata',[EMAIL PROTECTED]); } This action will then forward to /assettracker/get_data to retrieve the data from the queue and display it in the browser. I know that the code is not great, but it works. Thank you for all the assistance that I received. Regards Morne -----Original Message----- From: Bill Moseley [mailto:[EMAIL PROTECTED] Sent: 12 September 2008 09:46 PM To: The elegant MVC web framework Subject: Re: [Catalyst] Pushing data to Catalyst powered web page On Fri, Sep 12, 2008 at 02:15:23PM +0200, Supra, Morne wrote: > > The problem that I have is that I have no idea how to push the data to a > web page instead of pulling. Pull with an AJAX update, perhaps. -- Bill Moseley [EMAIL PROTECTED] Sent from my iMutt _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to [EMAIL PROTECTED] and we will send you a copy of the Disclaimer. _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/