Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
Question
Book Icon
Chapter 11, Problem 11.8HW
Program Plan Intro

IP addresses:

  • The IP address denotes an unsigned integer that is 32-bit.
  • The IP addresses is been stored by network programs in IP address structure.
  • The addresses present in IP address structure are stored in network byte order.
  •  An unsigned 32-bit integer is transformed from host byte order to network byte order by “htonl” function.
  • An unsigned 32-bit integer is transformed from network byte order host byte order by “ntohl” function.
  • The IP address is presented to humans in a form known as “dotted-decimal” notation.
    • Each byte is been represented by its corresponding decimal value and is separated by a period from other bytes.

Passing program arguments to server:

  • The arguments for “GET” requests are passed in the URI.
  • The character “?” separates filename from the arguments.
  • The character “&” separates each argument.
  • The arguments do not allow spaces in it.

Server passes arguments to child:

  • The server calls “fork” to create a child process and calls “execve” to run program in child’s context once it receives a request.
  • The child process sets CGI environment variable values.
  • The “adder” program can reference it at run time using “getenv” function of Linux.

Output is sent by child:

  • The dynamic content of a CGI program is to be sent to standard output.
  • A CGI program sends dynamic content to standard output.
  • It uses “dup2” function for redirecting standard output to connected descriptor associated with client.
  • The result written to standard output by CGI program, it goes directly to client.

Blurred answer
Students have asked these similar questions
The fingerprint-based voting application can recognize users based on their fingerprint patterns. Since fingerprint authentication is unique for each person, the system can quickly identify the voters using their fingerprints. Naturally, a voter can vote for a candidate only once. The Admin adds all the names and photos of the candidates nominated for the election. The Admin then authenticates users by verifying their identity proof, and after verification, the voter is registered in the system. Furthermore, the Admin even enters the data when the election will end, after which the system will automatically delete the names and photos of the candidates and voters. The users can log in to the system via the unique user ID and password given by the Admin and then use their fingerprints to vote for their preferred candidate. Once the election is over, and the votes are counted, Both the Admin and users can view the election result using the election ID.   In the capacity of a System…
Machine learning . Implement the Naive Bayes for Spam sms detection from Scratch using Python.You should use appropriate dataset for training and testing.Implement a simple GUI allowing users to enter a SMS and the program will display whether it is a spam or not using the Naive Bayes algorithm.
Your task is to develop a Tic-Tac-Toe (also called as “Noughts and Crosses”) game in Java using Swing. In this assignment, you are asked to implement a single-player version of the Tic-Tac-Toe game with easy-to-use graphical user interface (GUI). One player will be the user and the second player will be artificial intelligence (AI), namely, the computer. The entire procedure of the implementation has been split into three tasks with detailed description and explanation provided. By completing the three tasks, you will develop your own Tic-Tac-Toe game. Task 1: GUI ImplementationPlease implement a GUI satisfying the following requirements.• A menu bar with two buttons “Reset” and “Quit”. User can click the “Reset” button to restore the software to the initial status. User can software the game by clicking the “Quit” button;• The top pane is an information board to display username and present some basic guidance to the user about this game. The information board will also print out the…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education