See who is online and Instant messages

Last post 07-03-2009 3:34 AM by vivek_iit. 1 replies.

Sort Posts:

  • See who is online and Instant messages

    07-02-2009, 11:11 AM

    Got a questiona about the design of my site and wonder if there is a way to improve it. Its a socail networking site and i need to see what users are online. So have a row in my db called lastactivetime. I have a ajax timer run every 10 seconds and update that value for multiple reason. To make sure there active and to get status changes such to change a link button if there is a email or find out if they have a pending IM incoming. So i find it important that i can have as accrute way of telling if some one is online. Also when there is a incoming IM I open up a new window and kinda just have another ajax timer that ticks ever second to see if there is a new message. Is there any way to improve this? I think it would really cpu and db expensive on the servers.

  • Re: See who is online and Instant messages

    07-03-2009, 3:34 AM
    Answer
    • All-Star
      17,710 point All-Star
    • vivek_iit
    • Member since 06-18-2006, 2:13 PM
    • New Delhi
    • Posts 3,171
    • TrustedFriends-MVPs

    You can try using SqlCacheDependency (if you are using SQLServer) so that the DB service will ping your ASP.NET application when the data in the watched table changes. So instead of pinging the DB , you will get a notification from the DB itself when a new message gets inserted for that user. Refer this link:

    http://www.codeproject.com/KB/database/chatter.aspx

    HTH,

    Vivek

Page 1 of 1 (2 items)