my dog learned polymorphism
The moose likes Distributed Java and the fly likes handling 2 clients in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "handling 2 clients in RMI" Watch "handling 2 clients in RMI" New topic
Author

handling 2 clients in RMI

sachin dabhade
Ranch Hand

Joined: Mar 10, 2001
Posts: 73
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

Joined: Oct 25, 2000
Posts: 7292

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: handling 2 clients in RMI
 
Similar Threads
communicating multiple sockets
RMIRegistry on Solaris
Socket Programming
multiple clients
XML over HTTP embedded server problems