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 <koz...@gmail.com> 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 google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.