Question

In: Computer Science

why we need socket programming? what its application.

why we need socket programming? what its application.

Solutions

Expert Solution

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.


Related Solutions

Implement the following socket programming in C (b) Chat Application using TCP
Implement the following socket programming in C (b) Chat Application using TCP
Research the number of programming environments that support a socket interface.
Research the number of programming environments that support a socket interface.
Why do we need internal control in an organization? What is its purpose, and what are...
Why do we need internal control in an organization? What is its purpose, and what are its objectives (not components)? Can you explain with examples?
I am new to socket programming and I wish to know what these lines of code...
I am new to socket programming and I wish to know what these lines of code do. I know they are creating UDP sockets, but it would help if someone explained what the code means. Thank you. Python Code: import socket testingSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) testingSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, testingSocket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) testingSocket.bind(('0.0.0.0', 50000)) send_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) send_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) receiving_thread = Thread(target=self.receivingFunction) send_thread = Thread(target=self.sendMessage) broadcast_online_status_thread = Thread(target=onlineStatus)
In this homework, you will practice and reinforce the basics of socket programming for TCP connections...
In this homework, you will practice and reinforce the basics of socket programming for TCP connections in Python: how to create a socket, bind it to a specific address and port, as well as send and receive a HTTP packet. You will also learn some basics of HTTP header format. The requirements for this homework are specified below. 1. Function Requirement: You will develop a web server that handles one HTTP request at a time. Your web server should accept...
Java Programming I need an application that collects the user input numbers into an array and...
Java Programming I need an application that collects the user input numbers into an array and after that calls a method that sums all the elements of this array. and display the array elements and the total to the user. The user decides when to stop inputting the numbers. Thanks for your help!
Can you explain why we need server-side programming? (cite at least 3 reasons)
Can you explain why we need server-side programming? (cite at least 3 reasons)
We need a Stock and Bond trading application. Here is what is required: Create Menu with...
We need a Stock and Bond trading application. Here is what is required: Create Menu with the options organized as below: ******************************************************************************** A. Buy Bonds B. Sell Bonds C. Buy Stocks D. Sell Stocks E. Short Stock Sale    X. Exit Here are the steps involved. Create a char variable named menuChoice. Display the menu as described above. Prompt for the menu choice (A-E,X) (Assume the input will be uppercased). Use an IF statement to validate that the choices are...
What is Linear Programming? Give an example of an application of Linear
What is Linear Programming? Give an example of an application of Linear
Monetary policy a) Why do we need monetary policy and what is its purpose? (10 marks)...
Monetary policy a) Why do we need monetary policy and what is its purpose? b) What are the main transmission channels by which monetary policy achieves its objectives?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT