In: Computer Science
why we need socket programming? what its application.
Answer:
Socket programming which enables two or more hosts to communicate
with each other. It shows how to use socket APIs to establish
communication. Unless you’re making a standalone application,
communication with “peers” is a necessity. Therefore the usage of
the basic protocols like TCP/UDP or its underlying protocols
(HTTP/DCHP) all lie under socket programming.
The process which uses a socket can reside on the same computer or
different systems on different networks. Sockets are useful for
both network applications and stand-alone application. A number of
languages support socket programming like C, C++, Java, etc.
We can get data from any data from the internet using sockets like
you can get the IP address of any particular host, Header
information, web source, etc. Inter-Process communication can
perform using socket programming. More than two processes can
communicate using sockets. This is majorly used in the operating
system. If one process required some information from other
processes. It just creates a socket and it will get the details
accordingly. We can also transfer files or messages from one
computer to another computer. We can create any server, client
applications like FTP, DNS, HTTP, etc.