Tuesday 15 July 2014

GWTP (GWT-Platform) and remote events -


RPC I hear / firing use GWTEventService remote event, but how do I GWT Can do this with -Platform Are there any chances of incidents of fire from a server to a specific client? For example Cॅtplifikeshn

thx

We have a unique domain for each user After the user logged in, we generated a GUID for the user, and loaded it from the client through RPC. . And than we send an event to users using the GUID as the private domain ID

On the server:

  // CometMessageService public void sendPrivateMessage (in final string message, final protocols .SessionId sessionId) {getEventService () addEvent (DomainFactory.getDomain (sessionId.toString ().), new ServerMessageEvent (message)); }   

On Customer:.

  Remotiventsservis Iventsservis = Remotiventsservisefctorikgatinstans () Getremotiventsservis (); eventService.addListener (DomainFactory.getDomain (privateDomain), New RemoteEventListener () {public void apply (Event event) {if (ServerMessageEvent Instanceof event) {ServerMessageEvent messageEvent = (ServerMessageEvent) event; Info.display ( "user specific comet Send" MessageEvent.getMessage ());}}});   

Be free to ask me more details.

No comments:

Post a Comment