Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Professional XMPP Programming with JavaScript and jQuery
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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?
  #2 (permalink)  
Old September 21st, 2010, 06:39 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.