• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

handling 2 clients in RMI

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody,
i have a simple question.
i have an application where a clients sends a string and server accepts it,finds the string length and return it to client.
as far as this is concerned , all is fine.
but i want to send this string length to second client on the same server.
can anybody tell me how to go about it.
i know it may be simple but i am new to distributed technology.
thanks in advance,
sachini
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are tons of ways to do it, but the simplest way would be something like this: when the server computes the string length, all it has to do is keep a static copy of the value. When a subsequent client checks in (probably best done through a separate remote method), it then gets a return value equal to this local store.
From there, you can make this a WHOLE lot more complex, depending on your needs. But the bottom line is, the server has to maintain a persistent, "global" copy of the value.
 
    Bookmark Topic Watch Topic
  • New Topic