Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
send a message to all client when a user leave channel
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rico  
View profile  
 More options Jun 30, 10:16 am
From: rico <ric...@gmail.com>
Date: Tue, 30 Jun 2009 07:16:16 -0700 (PDT)
Local: Tues, Jun 30 2009 10:16 am
Subject: send a message to all client when a user leave channel
Hello :)

I wonder how it could be possible to send a message when a user leave
the channel.

In the case of a chat example, when a user join the chanel and send
his first message, all client could see his nickname on a sidelist.

But when this user leave the channel, how can we tell all subscribers
to remove this nickname in this sidelist ?

thanks by advance for response

rico


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jan Hančič  
View profile  
 More options Jun 30, 11:17 am
From: Jan Hančič <jan.han...@gmail.com>
Date: Tue, 30 Jun 2009 17:17:40 +0200
Local: Tues, Jun 30 2009 11:17 am
Subject: Re: send a message to all client when a user leave channel

Hi,
define a unload event handler and make a AJAX call to your server, telling
it the client is logging off. And send an updated list of present users
trough a channel.
Just make sure you make a synchronous AJAX request (some browsers do not
allow asynchronous requests in the unload event).

There will still be cases where you will have "zombie" users, because, for
some reason or other, the unload event won't fire.
I solved this so that every client updates it's last seen flag on the server
every X minutes, and then I made a cron script that runs every X minutes and
removes the "zombie" clients and sends a new list to connected clients.

Hope this helps.

--
Jan Hančič
http://hancic.info


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rico  
View profile  
 More options Jul 1, 5:01 am
From: rico <ric...@gmail.com>
Date: Wed, 1 Jul 2009 02:01:07 -0700 (PDT)
Local: Wed, Jul 1 2009 5:01 am
Subject: Re: send a message to all client when a user leave channel
Hi Jan,

thanks a lot for response.

i was thinking about an unload event handler so i think i will follow
the way you did it.

have a nice day

rico

On 30 juin, 17:17, Jan Hančič <jan.han...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google