A socket is an End-Point of 2 sided or two-way communication link between two PCs running on the network. For Example: If there are two people in different places who want to communicate with each other and each of them has a mobile phone. So one of them has to start the communication by dialing the person and then the other person receives the call then the connection will be established between these two. Once, the connection is established then they can start communicating with each other by sending and accepting messages so that is how a simple mobile phone end-to-end communication works, here the mobile phones act as a socket and endpoint of communication.
How communication is done?
To communicate both devices need to have sockets at their end. Since we’re doing java programming these sockets are called java objects or socket objects. So to establish a connection and to send and receive messages and data both ends need to have a socket at the sender’s end and at the receiver’s end. Below is the illustration of the network
How sockets are used to send and receive data?
Advantages and Disadvantages of Java Sockets
Advantages | Disadvantages |
Flexible & powerful | Increased complexity cost and high-Security restrictions. |
Very sufficient | Socket-based communications allow only to send packets of raw data between applications. |
Updated Information can be used to send only between devices | Communication can be established with the machine requested not with another machine. |
Low network traffic if efficient use | Both ends should have the ability to intercept the data. |
0 comments:
Post a Comment