Change the "receiver.AddEvent(evt)" method to the
broadcastEvent(evt,null).. so every client listening will receive a
SendMessageEvent and act properly...
public void sendMessage(User receiver, String message) {
Usuario sender = getCurrentUser();
if( receiver != null ){
SendMessageEvent evt = new SendMessageEvent(sender,message);
synchronized(receiver){
//receiver.AddEvent(evt); <- comment this line, cause here whe
are sending the message only to receiver!
broadcastEvent(evt,null); // and use this one already documented
on the book
onEvents(receiver.getId() );
}
}
//the receiver User are not needed anymore so you can change the
method signature to sendMessage(String message)
}
Regards,
Fabio Kaminski
On Wed, Mar 3, 2010 at 12:16 PM, kozura <[email protected]> wrote:
> Read the book again, with care?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.