With the socket-to-socket connection you have to:
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.
<ah*********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Thanks for your comments Alex.
Makes sense, except - Why is a direct socket-socket connection harder
to do than RMI? Would it not be easier to do?