Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthoreplawless
    • CommentTimeAug 29th 2006 edited
     permalink
    I've coded an AJAX chatroom, where the client sends a request to check for new messages every .4 seconds. Unfortunately every once in a while the request doesn't go through, which doesn't matter so much for checking messages, but logging on/off the chatroom uses the same method, and the list of users online doesn't update properly if the request doesn't go through. How do I make the client wait until the server is free to send requests?
    • CommentAuthorvarland
    • CommentTimeAug 29th 2006
     permalink
    If you're having problems, don't use AJAX for the critical requests. Refresh for logging in and out.
    Also, how did you come up with .4 seconds? That seems a little much... I would think that you could check once a second, and then you're only putting 40% as much stress on your server. If you do that, you'll be able to process more requests.
    • CommentAuthoreplawless
    • CommentTimeAug 29th 2006 edited
     permalink
    0.4 seconds was a result of testing with a couple people, general consesus was that it should be that responsive. It massacred the server, so I did some tweaking and it runs along pretty well with 5-6 people.
    Logging in and out is actually just loading and unloading the site, with an ajax request on sign out. I brought the refresh back up to 1 second but the problem persists, even with just one user online. Is there no way to check whether the server is busy, and resubmit the request until it goes through?
    • CommentAuthorvarland
    • CommentTimeAug 29th 2006
     permalink
    If the problem persists, it may not be server load. How about posting some code or a link?
    • CommentAuthoreplawless
    • CommentTimeAug 29th 2006 edited
     permalink
    ummm......... 'kay. It's running on my design pc's testing server so I am fully prepared for it to be royally screwed.
    It does not work in IE for some reason I have yet to determine.

    http://ajaxim.cjb.net/
    • CommentAuthorvarland
    • CommentTimeAug 29th 2006
     permalink
    I'd need to see some of the PHP to help more. The only suggestion I would have so far is to use some more "best practice" AJAX... Don't use innerHTML, but rather DOM methods. And don't return HTML from a PHP script (which you look to be doing for your user list), but return XML, and let javascript parse it.
Add your comments
    Username Password
  • Format comments as (Help)