1.

What do you understand about Socket Programming? State the advantages and disadvantages of Sockets in Java.

Answer»

Socket programming is a technique for allowing two network nodes to communicate. One socket (node) listens for traffic on a specified port at a specific IP address, while the other socket connects to it. The listener socket is created by the server while the CLIENT is connected to it.

Some advantages of Java Sockets are as follows:

  • Sockets are versatile and sufficient. Socket based programming is straightforward to implement for ordinary communications.
  • Sockets are to blame for low network traffic. Unlike HTML forms and CGI scripts, which construct and send entire web pages for each new request, Java applets can simply send the changed information.

Some disadvantages of Java Sockets are as follows:

  • Security CONSTRAINTS can be burdensome at times because a Java applet running in a Web BROWSER can only connect to the machine from which it came and nowhere else on the network.
  • Socket based connections, despite all of Java's advantages, are LIMITED to the delivery of raw data packets between programs. Both the client and the server must provide mechanisms for turning the data into something useful.
  • Because data formats and protocols are application-specific, socket-based systems are limited in their reusability.


Discussion

No Comment Found