Wrox Programmer Forums
|
BOOK: Professional XMPP Programming with JavaScript and jQuery
This is the forum to discuss the Wrox book Professional XMPP Programming with JavaScript and jQuery by Jack Moffitt; ISBN: 978-0-470-54071-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2010, 05:24 PM
Registered User
 
Join Date: Sep 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bare JID & too many resources

I want to use XMPP to push messages out to a page, which then formats and appends them, logging the messages it receives.

I considered MUC or pubsub, but I don't want people to have to log in to see the log, and both seem to require a log in for each person receiving messages.

What I've done is hard-coded a username and password. The page automatically logs in and starts listening for messages. Elsewhere, I send the messages to the bare JID. Since all the logs have equal priority, the message gets sent to all of them.

This works great at first, but once I hit four logs, it falls apart. There's suddenly 30-40 seconds between when the message is sent and when it shows up on the logs. Worse, not all the logs receive it, and sometimes some receive it multiple times.

Is there a limit on how many resources I can count on being able to send to with the bare JID? Can I use MUC or pubsub with one username/pass combo logging in multiple times?
 
Old September 21st, 2010, 06:39 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

Quote:
Originally Posted by tiracu View Post
I considered MUC or pubsub, but I don't want people to have to log in to see the log, and both seem to require a log in for each person receiving messages.

What I've done is hard-coded a username and password. The page automatically logs in and starts listening for messages. Elsewhere, I send the messages to the bare JID. Since all the logs have equal priority, the message gets sent to all of them.
The better solution is to use SASL ANONYMOUS. The pubsub subscriptions will then be temporary, and the clients will only get publishes while they are online. Once they log off, their subscription will get cleaned up.

On the client side, you log in as anonymous, then subscribe to the log node, and just handle the incoming publish messages.


I have no idea why you'd see the behavior you do with multiple resources, but i'm guessing that this isn't a well tested code path. If you want to continue doing it that way, you might try a second XMPP server implementation just to see if it does or doesn't have the same issue. Then at least you'd know for sure whether it was your code or the server.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Resources CaliGirl06 SQL Server 2000 2 April 18th, 2007 03:15 AM
Resources mike72 ASP.NET 2.0 Professional 0 January 3rd, 2006 08:25 AM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM
Resources vijay VB.NET 2002/2003 Basics 2 November 3rd, 2003 11:25 AM
VS.Net Resources brthede VS.NET 2002/2003 3 June 11th, 2003 03:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.