Recently, I've come across a problem wherein I have to design a website. I managed to get all of the login and site design stuff implemented, but one of the requirements is for a chat app. Using some code I've yet to properly license (it's a proof of concept thing, not an actual website), I managed to hack together a semi-working javascript-php Ajax thing with more bugs than I want to fix. Does anyone know of either some good tutorials for Javascript Ajax (already googled it, Kllrohj) or some third party code that I can properly attribute and use?
Why not play around with the released, old, flatfile-based version of SAX? Smile

http://www.cemetech.net/programs/index.php?mode=file&path=/web/phpbbmods/sax.zip
That looks really interesting, but I was looking for more of a facebook/forum style of posting.
Qwerty.55 wrote:
That looks really interesting, but I was looking for more of a facebook/forum style of posting.
You could easily modify it for that sort of thing, I think. You mean where conversations each take place between two users, and you can have N+(N-1)+(N-2)+...+1 different possible conversations given N users? Or something different?
It's quite a bit simpler than that. There might be N users, but it's guaranteed (because of federal mandates, no less), that only 2 will ever be engaged in the same conversation. I merely have to provide some capability to engage in those conversations. I thought posting would be the most intuitive and permanent.
Indeed, I believe that's equal to the number that I gave you. Smile This could be modified for posting, but in that case, why bother using AJAX at all?
My bad site design broke the user menu into tabs that would change if the user refreshed the page Razz
Qwerty.55 wrote:
My bad site design broke the user menu into tabs that would change if the user refreshed the page Razz
Yeesh, sounds like you should start with fixing it there, then. Wink But you definitely could have a database either of messages (select * from messages where (sender='$user1' and recipient='$user2') or (sender='$user1' and recipient='$user2') ORDER BY timestamp DESC), or of conversations internally delimited, and use AJAX to periodically ping the database for new messages.
Qwerty.55 wrote:
Recently, I've come across a problem wherein I have to design a website. I managed to get all of the login and site design stuff implemented, but one of the requirements is for a chat app. Using some code I've yet to properly license (it's a proof of concept thing, not an actual website), I managed to hack together a semi-working javascript-php Ajax thing with more bugs than I want to fix. Does anyone know of either some good tutorials for Javascript Ajax (already googled it, Kllrohj) or some third party code that I can properly attribute and use?


Kllrnohj actually constructed a pretty fast chat app a while back as a proof-of-concept.
One of the tutorials I used when I made my chat webapp was this: http://www.ibm.com/developerworks/library/x-ajaxxml8/
Elfprince: So he did. One thing I've always wanted to play with his Keep-Alive HTTP connections, which would reduce the number of new sockets the server would have to open, but might require Apache to allow more than the default of 100 open sockets at a time.
I managed to hack some PHP and javascript together after looking at Sax. Unfortunately, all my connections to the server stop responding after about three minutes of running it and it takes a couple hours to recover...
Qwerty.55 wrote:
I managed to hack some PHP and javascript together after looking at Sax. Unfortunately, all my connections to the server stop responding after about three minutes of running it and it takes a couple hours to recover...
Are you doing connection: close or connection: keep-alive?
For some reason, the problem magically disappeared when I slowed down the refresh rate and threw six more users on to stress test it. On a related note, the testers found quite a few more "bugs," including the lack of unicode support.
Qwerty.55 wrote:
For some reason, the problem magically disappeared when I slowed down the refresh rate and threw six more users on to stress test it. On a related note, the testers found quite a few more "bugs," including the lack of unicode support.
I'm glad to hear the bugs disappeared, although I'm as uneasy as I always am when bugs mysteriously disappear without having been actively solved. If you need (and are allowed to get) more beta testers, I'm sure you could find willing parties here.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement