File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes What's merit and demerit of Socket Connection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "What Watch "What New topic

What's merit and demerit of Socket Connection?

Vince Cheung

Joined: Dec 06, 2004
Posts: 16
What's merit and demerit of Socket Connection?
Barend Garvelink
Ranch Hand

Joined: Dec 07, 2004
Posts: 64
You can drop in an RMI connection fairly transparently, but with agonizingly little control. Implementing a socket connection gives you all the power but a lot more things that might go wrong.

SCJP 1.4, SCJD 1.4, SCWCD 1.3, ICSD:Websphere 5.1
Omar Kalaldeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 58
Advantages of sockets:
  • Can be more efficient and scalable than RMI (if good implemented).
  • You have control on how to handle concurrent clients; You can make it simple or complex as your requirements.
  • You don’t have to worry about extra work came with RMI, like registering RMI server, and working with firewalls.

  • Advantages of RMI
  • In Designing, RMI more close to Object oriented than sockets.
  • It is simpler in coding, and you don’t have to worry about thread pooling.

  • You have to choose RMI or a socket, depending on what is best for your project (from your point of view).

    For example being the socket more efficient may not be important since number of users connecting to system is very small.

    So it is not a matter of how many points you can find in favor or against socket, but what is more suitable for your project.

    Best Regards <br /> <br />Omar F. Kalaldah<br />---------------------<br />SCJP, SCJD, SCBCD
    I agree. Here's the link:
    subject: What's merit and demerit of Socket Connection?
    It's not a secret anymore!