Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

handling 2 clients in RMI  RSS feed

 
sachin dabhade
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
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!