I was thinking of using RMI to do the sending from the client, but it
seems to be an overkill to use RMI just for sending data. Is there a
better solution using an alternate technology? Thanks!
You can use a floppy, or burn a CD.
In my experience, RMI is suited for the data exchange just fine.
<ahmad...@gmail.com> wrote in message
news:1111674745.9...@o13g2000cwo.googlegroups.com...
1. create an anchor (server) socket on the server side
2. create the connecting socket in the client
3. organize the read/write loops with blocking i/o
4. serialize and de-serialize your data (if it includes objects)
With the RMI, you only need to create a server object, bind it to the
registry and export it on the selected port (equivalent of 1 in the s-s
scenario). You also have to create the RMI stubs by running rmic, but this
can be done once in a script/bat file, and put the Naming.lookup code in
your client (equivalent of 2). After that, you are free to send/receive any
data through simple method calls, without worrying about serialization, i/o
etc. Items 3 and 4 in the s-s version are gone.
RMI is a higher-level abstraction of the socket mechanism, with lots of
mundane socket stuff hidden, and lots of convenience wrapping added.
Decide for yourself, which is easier. Or, if in doubt, try the sockets
first, and it won't be long before you quit and turn to the RMI.
<ahmad...@gmail.com> wrote in message
news:1111693461....@g14g2000cwa.googlegroups.com...