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 January 25th, 2011, 02:20 PM
Authorized User
 
Join Date: Jan 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default connection.attach()

i am able to attach to a connection within a 60 sec window. anything above this the connection is non responsive.

is this a strophe limitation or ejabberd limitation?

thanks.
 
Old April 18th, 2011, 07:34 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

ejabberd controls how long a connection can be unused before it is terminated. This is probably configurable, or you could add support to strophe for session pause which allows you to tell the server how long you plan to pause.
 
Old April 19th, 2011, 10:37 AM
Authorized User
 
Join Date: Jan 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for the reply... i looked at ejabberd config and could not find a connection timeout in the file, any pointers on what i should be looking?


This is the what I'm trying to achieve,
As soon as a user gets authenticated the user should be able to send and receive XMPP messages (like in facebook, where as soon as i login chat is enabled).

so, i would like to put sid and rid into the database, when a user gets authenticated, sid & rid will come back and the user is ready to make XMPP requests, immediately upon authentication.

So there is no specific pause time, user can come back in a few mins, hrs or even days. is this feasible?

i'm planning to create a service to create sid and rid for users and put them in the database, is there an easier way to achieve instant XMPP connection like in facebook?

Thanks,
 
Old April 19th, 2011, 10:50 AM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

It's not feasible or desirable to store the sid/rid and keep an open connection for more than a few minutes. One reason for this is that any messages the user receives while they are away will potentially disappear. If they are offline, those messages will get stored on the server.

If you just want the startup time to be minimized, you can simply use HTTP pre-binding to return a fresh sid/rid in a single request, at which point the client will be ready to chat. There's no reason that it needs to be the same as the old sid/rid.

See chapter 12 for an example of this.
 
Old April 19th, 2011, 01:53 PM
Authorized User
 
Join Date: Jan 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did not understand this chapte the first time i read it, it makes sense now.
thanks for the pointers, i'll try this technique out.

i'm an asp.net developer and would like to create an c# class similar to the code you have in boshclient.py to create xmpp connections from server pages. is there some documentation about this file? will be helpful.


thanks,
 
Old April 30th, 2011, 07:07 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

You can read about how to create BOSH sessions in XEP-0124 and XEP-206.

http://xmpp.org/extensions/xep-0124.html
http://xmpp.org/extensions/xep-0206.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Connection.attach flossy BOOK: Professional XMPP Programming with JavaScript and jQuery 15 January 19th, 2012 01:08 PM
cant attach any of the databases jonjoe BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 August 20th, 2009 07:29 AM
How can i attach my sig? Pukanhez Forum and Wrox.com Feedback 2 February 2nd, 2009 08:27 AM
Hi, how can i attach signature? puzobok Forum and Wrox.com Feedback 1 September 12th, 2008 10:51 AM
Attach Database ! pamyral_279 VS.NET 2002/2003 2 May 17th, 2005 07:08 AM





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