The document discusses developing a web server using C language. It describes the functions of a web server including delivering web pages and content to clients in response to HTTP requests. It outlines the key steps in developing a web server in C, including creating listening sockets, forking child processes to handle connections, reading requests, and sending responses. It provides pseudocode examples for functions like log(), web(), and main() that would be used in a C web server. Finally, it discusses the system calls involved in the request/response process at the client and server sides.
The Hypertext Transfer Protocol (HTTP) is an application layer protocol for distributed, collaborative, hypermedia information systems and is the foundation for data communication on the World Wide Web. HTTP defines methods like GET and POST to indicate the desired action on a resource and uses status codes in responses. It also uses headers in requests and responses to define parameters of the transaction. HTTP typically uses TCP port 80 to allow a client to open a connection and send requests to a server, which responds with messages that may contain requested resources or error information.
An overview of the HTTP protocol showing the protocol basics such as protocol versions, messages, headers, status codes, connection management, cookies and more.
But it still remains an overview without in-depth information. Also some key aspects are left out (because of limited time) such as authentication, content negotiation, robots, web architecture etc..
This document provides an overview of Perl scripting and CGI programming. It covers topics such as the introduction to CGI, how CGI works, preparing CGI programs, the history and features of Perl, and how to write basic Perl CGI programs. The document is intended to help participants understand Perl scripting and CGI programming after completing this training.
The document discusses Common Gateway Interface (CGI) and Perl scripting. It begins with an introduction to CGI, including its definition, architecture, and how it works. It then provides an overview of Perl, including its history and features. The document aims to help participants understand CGI programming and Perl scripting.
This document provides information about Python CGI (Common Gateway Interface) programming. It discusses what CGI is, how information is exchanged between a web server and CGI script, and gives an example of a simple "Hello World" Python CGI script. It also covers CGI architecture, configuration, passing data to CGI scripts using GET and POST requests, and handling different HTML form elements like textboxes, checkboxes, radio buttons, and dropdown menus in CGI scripts.
Web services allow programs to call methods on other computers over a network. They are frequently web APIs that can be accessed remotely and executed on another system. Web services consist of method information describing the method being called and scoping information describing required arguments. This information is packaged and sent across the network using various protocols like HTTP, SOAP, and XML-RPC. The internet protocol stack, consisting of layers like application, transport, network and link, is used to break information into packets that can travel over the network to their destination and be reassembled.
CGI (Common Gateway Interface) is an interface that allows a web server to launch external applications dynamically in response to requests. It defines standard communication variables between the web server and CGI programs. CGI programs can be written in any programming language and are executed by the web server to generate dynamic web page content on the fly based on request parameters and structured data. However, CGI has performance and security limitations due to creating new processes for each request.
CGI allows a web server to interface with external applications to dynamically generate web pages. It uses environment variables and form data passed via GET or POST requests to run scripts or programs that process input and return output to the server. While CGI provides interactivity, it can be slow and has security issues. Server-side includes and client-side scripting offer alternatives for dynamic content generation.
The Hypertext Transfer Protocol (HTTP) is an application layer protocol for distributed, collaborative, hypermedia information systems and is the foundation for data communication on the World Wide Web. HTTP defines methods like GET and POST to indicate the desired action on a resource and uses status codes in responses. It also uses headers in requests and responses to define parameters of the transaction. HTTP typically uses TCP port 80 to allow a client to open a connection and send requests to a server, which responds with messages that may contain requested resources or error information.
An overview of the HTTP protocol showing the protocol basics such as protocol versions, messages, headers, status codes, connection management, cookies and more.
But it still remains an overview without in-depth information. Also some key aspects are left out (because of limited time) such as authentication, content negotiation, robots, web architecture etc..
This document provides an overview of Perl scripting and CGI programming. It covers topics such as the introduction to CGI, how CGI works, preparing CGI programs, the history and features of Perl, and how to write basic Perl CGI programs. The document is intended to help participants understand Perl scripting and CGI programming after completing this training.
The document discusses Common Gateway Interface (CGI) and Perl scripting. It begins with an introduction to CGI, including its definition, architecture, and how it works. It then provides an overview of Perl, including its history and features. The document aims to help participants understand CGI programming and Perl scripting.
This document provides information about Python CGI (Common Gateway Interface) programming. It discusses what CGI is, how information is exchanged between a web server and CGI script, and gives an example of a simple "Hello World" Python CGI script. It also covers CGI architecture, configuration, passing data to CGI scripts using GET and POST requests, and handling different HTML form elements like textboxes, checkboxes, radio buttons, and dropdown menus in CGI scripts.
Web services allow programs to call methods on other computers over a network. They are frequently web APIs that can be accessed remotely and executed on another system. Web services consist of method information describing the method being called and scoping information describing required arguments. This information is packaged and sent across the network using various protocols like HTTP, SOAP, and XML-RPC. The internet protocol stack, consisting of layers like application, transport, network and link, is used to break information into packets that can travel over the network to their destination and be reassembled.
CGI (Common Gateway Interface) is an interface that allows a web server to launch external applications dynamically in response to requests. It defines standard communication variables between the web server and CGI programs. CGI programs can be written in any programming language and are executed by the web server to generate dynamic web page content on the fly based on request parameters and structured data. However, CGI has performance and security limitations due to creating new processes for each request.
CGI allows a web server to interface with external applications to dynamically generate web pages. It uses environment variables and form data passed via GET or POST requests to run scripts or programs that process input and return output to the server. While CGI provides interactivity, it can be slow and has security issues. Server-side includes and client-side scripting offer alternatives for dynamic content generation.
HTTP is an application-level protocol for transmitting hypermedia documents across the internet. It uses a client-server model with requests containing a method, URL, and protocol version, and responses containing a status line and headers along with an optional body. Common methods include GET, POST, and HEAD. HTTP is stateless but can be made stateful through mechanisms like cookies.
This document provides an overview of the File Transfer Protocol (FTP) including how it works, the types of connections it uses, common FTP commands, and an example of downloading a file from an FTP server. FTP uses TCP connections on ports 20 and 21, with port 21 for control commands and port 20 for transferring files. Common commands include get to download files, put to upload, cd to change directories, and bye to log off. The example demonstrates connecting to an FTP server and navigating directories to download a specific file.
The document discusses HTTP requests and responses. It explains that HTTP is the most popular application protocol used on the internet. An HTTP client sends a request to a server, which returns a response. Requests use URLs to identify resources and consist of a request line and optional headers. Responses also include a status line and headers to provide information to the client. HTML forms allow sending request data to servers using GET or POST requests.
The document discusses sockets and how they allow communication between processes on the same or different machines. It defines sockets, describes their history and key characteristics like being bidirectional endpoints. It covers socket domains, types (stream, datagram), common functions like socket(), bind(), listen(), accept(), connect(), recv(), send() and close(). It explains how these functions work for both TCP and UDP clients and servers.
The Common Gateway Interface (CGI) allows web servers to interface with external applications. When a request is made for a CGI resource, the web server executes the associated program and returns the output. CGI programs can be written in many languages and access data passed in through environment variables or HTTP requests. Form data submitted via GET is appended to the URL, while POST submits data through standard input.
Overview of HTTP, HTML, WWW and web technologies.
The combo HTTP and HTML is the foundation of the World Wide Web (WWW).
HTML (HyperText Markup Language) defines a text-based format for describing the contents of a web page. HTML is based on tags similar to XML (eXtensible Markup Language), but its definition is less strict.
HTML pages are transported with the HTTP protocol (HyperText Transmission Protocol) over TCP/IP based networks.
The power of the WWW comes with the links based on URLs (Uniform Resource Locators) that connect pages to form a web of content.
Browsers display links as clickable items that, when clicked, trigger the browser to load the web page pointed to by the link.
This statelessness contributed a lot to the stability and scalability of the world wide web where web servers are only tasked with the delivery of web pages while the browser is responsible for the rendering of web pages.
The static nature of the early World Wide Web was soon augmented with the dynamic creation of web pages by web servers or by enriching static web pages with dynamic content.
Technologies like CGI (Common Gateway Interface), JSP (Java Server Pages) or ASP (Active Server Pages) were developed to provide the infrastructure to build dynamic web applications.
These server-side technologies were complemented with client-side technologies like Javascript and AJAX (Asynchronous Javascript And XML).
Web page caching is an important mechanism to reduce latency in loading web pages and reducing network traffic.
HTTP defines different caching control mechanisms. Simpler caching methods are based on web page expiry dates while more complex mechanisms use web page validation.
The document provides an overview of CGI (Common Gateway Interface) and how it enables dynamic web content. It discusses how CGI works, alternatives like PHP and Java servlets, configuring Apache web server for CGI, programming CGI applications using Perl and the CGI.pm module, handling input/output and errors. It also includes an example CGI application in Perl for counting button clicks using sessions and cookies to manage state.
This document provides an overview of Exchange Server and its key components. It describes the load balancer, HTTP proxy, IIS, and client access roles that front-end Exchange. It also explains the mailbox, transport, and Unified Messaging roles. The document discusses a single namespace example using geographical DNS and describes legacy coexistence with different Exchange versions. It summarizes the front-end and back-end transport pipelines and the flow of mail through Exchange. The caching behavior and resource usage of Exchange databases is depicted. Historical storage requirements and mailbox sizes across Exchange versions are shown. Finally, key Exchange concepts like the mailbox store, transport services, and database availability groups are explained at a high level.
The document summarizes several topics discussed at a Subversion conference. It introduces upcoming features in Subversion 1.7 including improved support for HTTPv2, a next generation working copy system, and new capabilities for modifying repository history. It also describes projects to implement the Subversion API in Java and provide commercial Subversion services.
This document summarizes a lecture on computer networks and the hypertext transfer protocol (HTTP). It first reviews the early history of computer networking and the development of the world wide web. It then provides details on HTTP, including requests and responses, methods, status codes, and cookies. It discusses how caching works to improve performance by satisfying requests locally when possible. Methods like If-Modified-Since are described which check if a cached object has been updated before retrieving from the origin server.
The document discusses the historical development of server-side technologies like CGI, PHP, and Java Servlets that allow dynamic content generation on web servers in response to user requests. It provides examples of how CGI scripts can be written in languages like Perl and Shell to handle forms, generate dynamic content, and interface with databases. The document also covers how PHP can be used for similar tasks and interfaces with databases and XML.
FTP or File Transfer Protocol is the mechanism used to transfer files over different networks. It is a standard network protocol, built on client-server architecture. It enables users to share their files over the network. Copy the link given below and paste it in new browser window to get more information on FTP Client and Server:- www.transtutors.com/homework-help/computer-science/ftp-client-and-server.aspx
The document discusses several application layer protocols used for remote access and file transfer over TCP/IP networks, including HTTP, Telnet, and SSH. It provides the following key details:
1. HTTP is the application layer protocol that defines how web clients and servers communicate to transfer web pages and other content. It allows clients to send requests for files and receive responses from servers.
2. Telnet is an older protocol that allows establishing terminal sessions with remote systems, making the local terminal appear like it is directly connected to the remote system. It uses options negotiation to configure settings like echoing of characters.
3. SSH was developed as a more secure replacement for Telnet, using encryption for authentication and data transfer
FTP allows two computers to connect over the Internet so that files can be transferred between a client and server. It was created in 1971 at MIT by Abhay Bhushan to transfer data over the new ARPANET. FTP works through a request, response, transfer, terminate cycle. It converts files to binary for transmission and allows downloading and uploading of files. While over 30 years old, FTP continues to be used and modified to meet user demands.
02.28.13 WANDisco SVN Training: Getting Info Out of SVNWANdisco Plc
Date: February 28 2013
Abstract: Need to build a report based on your Subversion project? This free-to-attend online training will share techniques for extracting information from Subversion, for reporting purposes.
Topics include:
- Difference information
- Using Project and User information
- Using Hook scripts to log information
Mike, a 33 year veteran of the software industry, has spent the past 26 years delivering consulting and training services for Subversion and other software configuration management systems. He has taught over 700 classes covering various aspects of implementing and using Subversion and other SCMs.
Mike is currently WANdisco’s Director of Subversion Training.
HTTP is an application-level protocol for distributed, collaborative hypermedia systems that has been used by the World Wide Web since 1990. The initial HTTP/0.9 version provided a simple protocol for raw data transfer, while HTTP/1.0 introduced MIME-like messages to include meta information and request/response modifiers. HTTP/1.0 did not sufficiently account for hierarchical proxies, caching, persistent connections or virtual hosts. HTTP sits at the top of the TCP/IP stack and uses ports to carry protocols between services, with HTTP typically using port 80. An HTTP message is delivered over a TCP/IP connection by chopping the message into chunks small enough to fit in TCP segments, which are then sent inside IP datagrams
This document provides an introduction to CGI (Common Gateway Interface) and PERL for creating dynamic web pages. It discusses what CGI and PERL are, how to set up the necessary directories and permissions, and how to write a basic CGI script in PERL. Key steps include creating a cgi-bin directory, writing the script with a shebang line to call the PERL interpreter, using print statements to generate HTML output, and testing the script locally and on a server.
The document discusses the Common Gateway Interface (CGI) which defines how web servers exchange information with custom scripts. CGI allows web servers to execute programs and return their output instead of files when certain files are requested. It requires the web server to be configured to support CGI, with programs stored in a special /cgi-bin directory. When a CGI program is executed, it has access to environment variables provided by the web server.
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional < ...
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional <.
HTTP is an application-level protocol for transmitting hypermedia documents across the internet. It uses a client-server model with requests containing a method, URL, and protocol version, and responses containing a status line and headers along with an optional body. Common methods include GET, POST, and HEAD. HTTP is stateless but can be made stateful through mechanisms like cookies.
This document provides an overview of the File Transfer Protocol (FTP) including how it works, the types of connections it uses, common FTP commands, and an example of downloading a file from an FTP server. FTP uses TCP connections on ports 20 and 21, with port 21 for control commands and port 20 for transferring files. Common commands include get to download files, put to upload, cd to change directories, and bye to log off. The example demonstrates connecting to an FTP server and navigating directories to download a specific file.
The document discusses HTTP requests and responses. It explains that HTTP is the most popular application protocol used on the internet. An HTTP client sends a request to a server, which returns a response. Requests use URLs to identify resources and consist of a request line and optional headers. Responses also include a status line and headers to provide information to the client. HTML forms allow sending request data to servers using GET or POST requests.
The document discusses sockets and how they allow communication between processes on the same or different machines. It defines sockets, describes their history and key characteristics like being bidirectional endpoints. It covers socket domains, types (stream, datagram), common functions like socket(), bind(), listen(), accept(), connect(), recv(), send() and close(). It explains how these functions work for both TCP and UDP clients and servers.
The Common Gateway Interface (CGI) allows web servers to interface with external applications. When a request is made for a CGI resource, the web server executes the associated program and returns the output. CGI programs can be written in many languages and access data passed in through environment variables or HTTP requests. Form data submitted via GET is appended to the URL, while POST submits data through standard input.
Overview of HTTP, HTML, WWW and web technologies.
The combo HTTP and HTML is the foundation of the World Wide Web (WWW).
HTML (HyperText Markup Language) defines a text-based format for describing the contents of a web page. HTML is based on tags similar to XML (eXtensible Markup Language), but its definition is less strict.
HTML pages are transported with the HTTP protocol (HyperText Transmission Protocol) over TCP/IP based networks.
The power of the WWW comes with the links based on URLs (Uniform Resource Locators) that connect pages to form a web of content.
Browsers display links as clickable items that, when clicked, trigger the browser to load the web page pointed to by the link.
This statelessness contributed a lot to the stability and scalability of the world wide web where web servers are only tasked with the delivery of web pages while the browser is responsible for the rendering of web pages.
The static nature of the early World Wide Web was soon augmented with the dynamic creation of web pages by web servers or by enriching static web pages with dynamic content.
Technologies like CGI (Common Gateway Interface), JSP (Java Server Pages) or ASP (Active Server Pages) were developed to provide the infrastructure to build dynamic web applications.
These server-side technologies were complemented with client-side technologies like Javascript and AJAX (Asynchronous Javascript And XML).
Web page caching is an important mechanism to reduce latency in loading web pages and reducing network traffic.
HTTP defines different caching control mechanisms. Simpler caching methods are based on web page expiry dates while more complex mechanisms use web page validation.
The document provides an overview of CGI (Common Gateway Interface) and how it enables dynamic web content. It discusses how CGI works, alternatives like PHP and Java servlets, configuring Apache web server for CGI, programming CGI applications using Perl and the CGI.pm module, handling input/output and errors. It also includes an example CGI application in Perl for counting button clicks using sessions and cookies to manage state.
This document provides an overview of Exchange Server and its key components. It describes the load balancer, HTTP proxy, IIS, and client access roles that front-end Exchange. It also explains the mailbox, transport, and Unified Messaging roles. The document discusses a single namespace example using geographical DNS and describes legacy coexistence with different Exchange versions. It summarizes the front-end and back-end transport pipelines and the flow of mail through Exchange. The caching behavior and resource usage of Exchange databases is depicted. Historical storage requirements and mailbox sizes across Exchange versions are shown. Finally, key Exchange concepts like the mailbox store, transport services, and database availability groups are explained at a high level.
The document summarizes several topics discussed at a Subversion conference. It introduces upcoming features in Subversion 1.7 including improved support for HTTPv2, a next generation working copy system, and new capabilities for modifying repository history. It also describes projects to implement the Subversion API in Java and provide commercial Subversion services.
This document summarizes a lecture on computer networks and the hypertext transfer protocol (HTTP). It first reviews the early history of computer networking and the development of the world wide web. It then provides details on HTTP, including requests and responses, methods, status codes, and cookies. It discusses how caching works to improve performance by satisfying requests locally when possible. Methods like If-Modified-Since are described which check if a cached object has been updated before retrieving from the origin server.
The document discusses the historical development of server-side technologies like CGI, PHP, and Java Servlets that allow dynamic content generation on web servers in response to user requests. It provides examples of how CGI scripts can be written in languages like Perl and Shell to handle forms, generate dynamic content, and interface with databases. The document also covers how PHP can be used for similar tasks and interfaces with databases and XML.
FTP or File Transfer Protocol is the mechanism used to transfer files over different networks. It is a standard network protocol, built on client-server architecture. It enables users to share their files over the network. Copy the link given below and paste it in new browser window to get more information on FTP Client and Server:- www.transtutors.com/homework-help/computer-science/ftp-client-and-server.aspx
The document discusses several application layer protocols used for remote access and file transfer over TCP/IP networks, including HTTP, Telnet, and SSH. It provides the following key details:
1. HTTP is the application layer protocol that defines how web clients and servers communicate to transfer web pages and other content. It allows clients to send requests for files and receive responses from servers.
2. Telnet is an older protocol that allows establishing terminal sessions with remote systems, making the local terminal appear like it is directly connected to the remote system. It uses options negotiation to configure settings like echoing of characters.
3. SSH was developed as a more secure replacement for Telnet, using encryption for authentication and data transfer
FTP allows two computers to connect over the Internet so that files can be transferred between a client and server. It was created in 1971 at MIT by Abhay Bhushan to transfer data over the new ARPANET. FTP works through a request, response, transfer, terminate cycle. It converts files to binary for transmission and allows downloading and uploading of files. While over 30 years old, FTP continues to be used and modified to meet user demands.
02.28.13 WANDisco SVN Training: Getting Info Out of SVNWANdisco Plc
Date: February 28 2013
Abstract: Need to build a report based on your Subversion project? This free-to-attend online training will share techniques for extracting information from Subversion, for reporting purposes.
Topics include:
- Difference information
- Using Project and User information
- Using Hook scripts to log information
Mike, a 33 year veteran of the software industry, has spent the past 26 years delivering consulting and training services for Subversion and other software configuration management systems. He has taught over 700 classes covering various aspects of implementing and using Subversion and other SCMs.
Mike is currently WANdisco’s Director of Subversion Training.
HTTP is an application-level protocol for distributed, collaborative hypermedia systems that has been used by the World Wide Web since 1990. The initial HTTP/0.9 version provided a simple protocol for raw data transfer, while HTTP/1.0 introduced MIME-like messages to include meta information and request/response modifiers. HTTP/1.0 did not sufficiently account for hierarchical proxies, caching, persistent connections or virtual hosts. HTTP sits at the top of the TCP/IP stack and uses ports to carry protocols between services, with HTTP typically using port 80. An HTTP message is delivered over a TCP/IP connection by chopping the message into chunks small enough to fit in TCP segments, which are then sent inside IP datagrams
This document provides an introduction to CGI (Common Gateway Interface) and PERL for creating dynamic web pages. It discusses what CGI and PERL are, how to set up the necessary directories and permissions, and how to write a basic CGI script in PERL. Key steps include creating a cgi-bin directory, writing the script with a shebang line to call the PERL interpreter, using print statements to generate HTML output, and testing the script locally and on a server.
The document discusses the Common Gateway Interface (CGI) which defines how web servers exchange information with custom scripts. CGI allows web servers to execute programs and return their output instead of files when certain files are requested. It requires the web server to be configured to support CGI, with programs stored in a special /cgi-bin directory. When a CGI program is executed, it has access to environment variables provided by the web server.
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional < ...
MCIS 6163 Assignment 1/MCIS 6163 Assignment 1.pdf
Assignment 1 – MCIS 6163
Building a Simple Web Client and a Multithreaded Web Server
Objectives
To understand client-server communication via sockets.
To gain exposure to the basic operations of a Web server and client.
To explore basic structures of HTTP messages.
Due: April 14, 2020 11:59pm
Project Description
In this project, you will be developing a multithreaded Web server and a simple web client. The Web
server and Web client communicate using a text-based protocol called HTTP (Hypertext Transfer
Protocol).
Requirements for the Web server
The server is able to handle multiple requests concurrently. This means the implementation is
multithreaded. In the main thread, the server listens to a specified port, e.g., 8080. Upon receiving an
HTTP request, the server sets up a TCP connection to the requesting client and serves the request in a
separate thread. After sending the response back to the client, it closes the connection.
The server is assumed to work with HTTP GET messages. If the requested file exists, the server
responds with “HTTP/1.1 200 OK” together with the requested page to the client, otherwise it sends a
corresponding error message, e.g., “HTTP/1.1 404 Not Found” or “HTTP/1.1 400 Bad Request”.
If running the server program using command line, the syntax should be:
server_code_name [<port_number>]
where the optional <port_number> is the port on which the server is listening to connections from
clients. If the port number is not entered, the default port 8080 is used.
You can test your Web server implementation on your local machine using a Web browser, e.g.,
Internet Explorer, Firefox, or Chrome. You need to specify the used port number within the URL, for
example,
http://localhost:8080/index.htm
If omitting the port number portion, i.e., 8080, the browser will use the default port 80.
The server should response with a default page when users do not enter a specific page in the URL,
for example,
http://localhost:8080/
It should also work when the request includes a path to the requested file, for example,
http://localhost:8080/path/to/file/example.htm
You should display/log the request and header lines of request messages on the server for the purpose
of debugging.
Requirements for the simple Web client
The client is able to connect to the server via a socket and to request a page on the server.
Upon receipt of the response message from the server, the client extracts and displays/logs the
message status, and then retrieves the page content from the message body.
If running the client program using command line, the syntax should be:
client_code_name <server_IPaddress/name> [<port_number>] [<requested_file_name>]
where the <server_IPaddress/name> is the IP address or name of the Web server, e.g., 127.0.0.1 or
localhost for the server running on the local machine. The optional <.
Web services allow programs to communicate over a network by calling methods on remote systems. They are frequently web APIs that can be accessed over a network like the internet. A web service call packages method and scoping information into an envelope that is transported across the network using defined protocols like HTTP and TCP. At the destination, the same protocols unpack the envelope and call the requested method. Web servers store web pages and dynamic content, and respond to client requests over the internet using HTTP to deliver HTML files and other objects.
This document discusses Java networking and client/server communication. A client machine makes requests to a server machine over a network using protocols like TCP and UDP. TCP provides reliable data transmission while UDP sends independent data packets. Port numbers map incoming data to running processes. Sockets provide an interface for programming networks, with ServerSocket and Socket classes in Java. A server program listens on a port for client connections and exchanges data through input/output streams. Servlets extend web server functionality by executing Java programs in response to client requests.
The document discusses various web technologies including:
- Core web technologies like browsers, servers, URIs and HTTP.
- Client-side technologies like HTML, CSS, JavaScript and HTML5.
- Server-side technologies for web applications like CGI, PHP, Java servlets and JSPs.
- How web applications use technologies like application servers to manage business logic and state in a dynamic way.
- Common methods for managing session state including cookies, databases and application servers.
FOR MORE CLASSES VISIT
tutorialoutletdotcom
Computer Networking MCIS 6163
Project 1
Simple Web Server & Client
Instructor: Sajib Datta
Spring 2017
"What I cannot create, I do not understand." Richard P Feynman Objectives
(A) To understand Client-Server communication via sockets
The document discusses servlet fundamentals and the three-tier model for web applications. It describes the three tiers as the client side (web browser), server side (web server/application server), and database (DBMS) tiers. It explains how servlets allow separating the business logic from the user interface, and how they provide dynamic web content through the Java programming language. Common Gateway Interface (CGI) and its drawbacks are also summarized.
Ch 22: Web Hosting and Internet Serverswebhostingguy
Web hosting involves providing space on a server for websites. Linux is commonly used for hosting due to its maintainability and performance. A web server software like Apache is installed to handle HTTP requests from browsers. URLs identify resources on the web using protocols like HTTP and FTP. CGI scripts allow dynamic content generation but pose security risks. Load balancing distributes server load across multiple systems. Choosing a server depends on factors like robustness, performance, updates, and cost. Apache is widely used and configurable using configuration files that control server parameters, resources, and access restrictions. Virtual interfaces allow a single server to host multiple websites. Caching and proxies can improve performance and security. Anonymous FTP allows public file downloads.
The document discusses network programming and the client-server model. It covers:
- The client-server exchange involves a client sending a request, the server handling the request and sending a response, and the client handling the response.
- Sockets provide a programming interface that allows network I/O to appear as file I/O. Clients and servers communicate by reading from and writing to socket file descriptors.
- Servers run as long-running daemon processes, listening on well-known ports for connection requests from clients. When a request is received, the server accepts the connection to form a connected socket for bidirectional data exchange.
The document describes a chat server application built using Java sockets. It includes a client and server component that allow users to login and send messages to each other. The server uses multithreading to handle multiple client connections concurrently by passing accepted socket connections to separate thread objects. The chat server provides group and private messaging capabilities and could be expanded in the future to include additional features like offline messaging, file sharing, and a user profile database.
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxkacie8xcheco
Project Assignment 2: Building a Multi-Threaded Web Server
This project assignment is due at the end of the seventh week of the course and is worth 7% of your total grade.
In this project, we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous service requests in parallel. Section 2.7 of your text may offer you some insight and help. You should be able to demonstrate that your Web server is capable of delivering your home page to a Web browser.
We are going to implement Version 1.0 of HTTP, as defined in
RFC 1945
, where separate HTTP requests are sent for each component of the Web page. The server will be able to handle multiple simultaneous service requests in parallel. This means that the Web server is multi-threaded. In the main thread, the server listens to a fixed port. When it receives a TCP connection request, it sets up a TCP connection through another port and services the request in a separate thread. To simplify this programming task, we will develop the code in two stages. In the first stage, you will write a multi-threaded server that simply displays the contents of the HTTP request message that it receives. After this program is running properly, you will add the code required to generate an appropriate response.
As you are developing the code, you can test your server from a Web browser. Just remember that you are not serving through the standard port 80, so you need to specify the port number within the URL that you give to your browser. For example, if your machine's name is
host.someschool.edu
, your server is listening to port 6789, and you want to retrieve the file
index.html
, then you would specify the following URL within the browser:
http://host.someschool.edu:6789/index.html
If you omit ":6789," the browser will assume port 80, which most likely will not have a server listening on it.
When the server encounters an error, it sends a response message with the appropriate HTML source so that the error information is displayed in the browser window.
Web Server in Java: Part A
In the following steps, we will go through the code for the first implementation of our Web server. Wherever you see "?," you will need to supply a missing detail.
Our first implementation of the Web server will be multi-threaded, where the processing of each incoming request will take place inside a separate thread of execution. This allows the server to service multiple clients in parallel, or to perform multiple file transfers to a single client in parallel. When we create a new thread of execution, we need to pass to the Thread's constructor an instance of some class that implements the
Runnable
interface. This is the reason why we define a separate class called
HttpRequest
. The structure of the Web server is shown below:
import java.io.* ;
import java.net.* ;
import java.util.* ;
public final class WebServer
{
public static void main(S.
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docxhanneloremccaffery
[Type text] ECET465
Project 2Project Assignment 2: Building a Multi-Threaded Web Server
This project assignment is due at the end of the seventh week of the course and is worth 7% of your total grade.
In this project, we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous service requests in parallel. Section 2.7 of your text may offer you some insight and help. You should be able to demonstrate that your Web server is capable of delivering your home page to a Web browser.
We are going to implement Version 1.0 of HTTP, as defined in RFC 1945, where separate HTTP requests are sent for each component of the Web page. The server will be able to handle multiple simultaneous service requests in parallel. This means that the Web server is multi-threaded. In the main thread, the server listens to a fixed port. When it receives a TCP connection request, it sets up a TCP connection through another port and services the request in a separate thread. To simplify this programming task, we will develop the code in two stages. In the first stage, you will write a multi-threaded server that simply displays the contents of the HTTP request message that it receives. After this program is running properly, you will add the code required to generate an appropriate response.
As you are developing the code, you can test your server from a Web browser. Just remember that you are not serving through the standard port 80, so you need to specify the port number within the URL that you give to your browser. For example, if your machine's name is host.someschool.edu, your server is listening to port 6789, and you want to retrieve the file index.html, then you would specify the following URL within the browser: http://host.someschool.edu:6789/index.html
If you omit ":6789," the browser will assume port 80, which most likely will not have a server listening on it.
When the server encounters an error, it sends a response message with the appropriate HTML source so that the error information is displayed in the browser window.
Web Server in Java: Part A
In the following steps, we will go through the code for the first implementation of our Web server. Wherever you see "?," you will need to supply a missing detail.
Our first implementation of the Web server will be multi-threaded, where the processing of each incoming request will take place inside a separate thread of execution. This allows the server to service multiple clients in parallel, or to perform multiple file transfers to a single client in parallel. When we create a new thread of execution, we need to pass to the Thread's constructor an instance of some class that implements the Runnable interface. This is the reason why we define a separate class called HttpRequest. The structure of the Web server is shown below: import java.io.* ;import java.net.* ;import java.util.* ;public final class WebServer{ public.
The document discusses various Internet application layer protocols including HTTP, DNS, and email. It provides details on how HTTP works, including the client-server model, HTTP request and response message formats, status codes, and caching. It also describes how DNS is used to map between hostnames and IP addresses through a hierarchy of root, local, and authoritative name servers.
This document provides an overview of networking concepts in Java including:
1) It outlines topics on networking basics like IP addresses, ports, protocols and client-server interactions.
2) It describes how to write networking clients and servers using sockets.
3) It provides an example of writing a simple ICQ client-server application to demonstrate sockets.
4) It discusses communicating with web servers by retrieving and sending information using URLs and URLConnections.
The document discusses the need for web servers to provide various web services for a company. It provides an overview of the history and development of the World Wide Web and web servers. It then describes key features and functions of the Apache web server, including caching, logging, mapping URLs to files, access control, server-side includes, and virtual hosting.
692015 programming assignment 1 building a multithreaded wsmile790243
The document describes the steps to build a multi-threaded web server in Java that can process multiple HTTP requests simultaneously in separate threads. It provides code snippets to create a basic server that displays request headers, and then extends it to analyze requests and send appropriate response messages containing status lines and file contents or error messages.
Server-side programming involves writing code that runs on a web server using languages like Java, PHP, and C#. It processes user input, displays pages, structures applications, and interacts with storage. Client-side programming writes code that runs in the user's browser using JavaScript. In a typical interaction, a user's browser requests a page from a server, which processes the request and returns the page which is then rendered in the browser. Common server-side programming languages and frameworks include PHP, Python, and ASP.Net. Web pages can be static with fixed HTML content or dynamic where the content changes based on server-side processing.
The document provides information on various web server software, web application servers, HTTP requests and responses, and the differences between web servers and application servers. It also discusses servlets, web applications, and the servlet API. Specifically, it lists popular web server software like Apache HTTP Server, Microsoft IIS, and Apache Tomcat. It explains how web application servers extend web servers to support dynamic content through templates, programs, and databases. It also defines the key components of HTTP requests and responses.
The document discusses Common Gateway Interface (CGI) and its drawbacks. It then introduces Servlets as an alternative to CGI for creating dynamic web content. Servlets avoid the performance issues of CGI by running within a Java Virtual Machine on the server and supporting multi-threading. The document covers the servlet lifecycle, API, deployment, and other features that make servlets faster and more scalable than CGI for building web applications.
1. WEB
SERVERS
Using C Language
Sujeet Kumar Singh
Web Developer
Web Server Using C Language 1
2. Introduction to Web Server
The primary function of a web server is to deliver web pages on the request to
clients. This means delivery of HTML documents and any additional content that
may be included by a document, such as images, style sheets and scripts.
A user agent, commonly a web browser or web crawler, initiates communication
by making a request for a specific resource using HTTP and the server responds
with the content of that resource or an error message if unable to do so The
so.
resource is typically a real file on the server's secondary memory, but this is not
necessarily the case and depends on how the web server is implemented.
Request
Web
Web
Client
Response Server
Web Server Using C Language 2
3. Request and Response header
A full request can contain more than one line, and a blank line must be sent at the end to
q
signify the end of the request.
GET /index.html HTTP/1.0
Host: www paulgriffiths net
www.paulgriffiths.net
User-Agent: Lynx/2.8.1rel.2 libwww-FM/2.14
Accept-Encoding: gzip, compress
Accept-Language: en
<BLANK LINE>
A response generated by the web server may be look like as shown below. A blank
A response generated by the web server may be look like as shown below A blank
line must be sent at the end to signify the end of the request.
HTTP/1.0 200 OK
Server: PGWebServ v0.1
Content-Type: text/html
<BLANK LINE>
Web Server Using C Language 3
4. Socket Programming in C
Socket programming is used to connect two process
running on two different host in a networking which
have an host address through a specified port
port.
A socket address is a combination of host address of
the host and port address used by it.
Socket Address=Host Address+ Port Address
Web Server Using C Language 4
5. Primary Header Files used in Socket Programming
Include file sequence may affect processing (order is important!)
<sys/types.h> - prerequisite typedefs
<errno.h> - names for “errno” values (error numbers)
<sys/socket.h> - struct sockaddr; system prototypes and constants
<netdb.h.h> - network info lookup prototypes and structures
<netinet/in.h> - struct sockaddr_in; byte ordering macros
<arpa/inet.h> - utility function prototypes
Web Server Using C Language 5
6. Various Steps in Development of Web Server in C
HTTP is essentially a text‐based protocol which runs over TCP/IP (though it can
HTTP i ti ll t t b d t l hi h TCP/IP (th h it
run over any transport protocol). The essential network steps are:
Create a listening socket
Accept a connection with it
p
Fork a child process to service the connection, while the parent process
goes back to accept more connections.
Read in the HTTP request
Send the HTTP response
Send the entity requested (e.g. an HTML document)
Send the entity requested (e g an HTML document)
Web Server Using C Language 6
7. Various Function of Web Server in C
Various C functions (user defined function) which are important for
V i C f ti ( d fi d f ti ) hi h i t tf
implementation of a web server are as follows:
log()
Logs messages to a log file. If the user requests an operation from
the Web server that is not allowed or can't be completed, then web server
tries to inform the user directly. This is done by returning a fake Web page to
the user that includes the error message. Since this function is only called
from the child Web server process, the function can (once completed) exit
and the main Web server process continues to allow further browser
connection requests. If this is not a recoverable error, then the process is
stopped.
web()
Deals i h h
D l with the HTTP b browser request and returns the d
d h data to the
h
browser. This function is called in a child process ‐‐ one for each Web request.
It also allows the main Web server process to continue waiting for more
connections. Checks are made to ensure the request is safe and can be
q
completed. After the checks have been made, it transmits the requested static
file to the browser and exits.
Web Server Using C Language 7
8. Various Function of Web Server in C
Various C functions (user defined function) which are important for
V i C f ti ( d fi d f ti ) hi h i t tf
implementation of a web server are as follows:
main()
This is the main Web server process function. After checking the
command parameters, it creates a socket for incoming browser requests, sits
in a loop accepting requests, and starts child processes to handle them. It
should never end.
Web Server Using C Language 8
9. Pseudo Code for the Functions
Pseudo code for the log() function is follows:
Pseudo code for the log() function is follows:
log()
{
outputs error, sorry or log messages to the web
server.log file
if a sorry message, t
transmit it t th b
it to the browser as a f k
fake
HTML response
if error or sorry message the p g
y g program is stopped
pp
}
Web Server Using C Language 9
10. Pseudo Code for the Functions
Pseudo code for the web() function is follows:
Pseudo code for the web() function is follows:
web() - this function returns the request back to the
browser
{
read from the socket the HTTP request
check it’s a simple GET command
check no parent di
h k t directory requested t escape th web
t t d to the b
servers home directory
if no file name given assume index.html
check the file extension is valid and supported
pp
check the file is readable by opening it
transmit the HTTP header to the browser
transmit the file contents to the browser
if LINUX sleep for one second to ensure the data arrives
at the browser
Stop
}
Web Server Using C Language 10
11. Pseudo Code for the Functions
Pseudo code for the main() function is follows:
Pseudo code for the main() function is follows:
main()
{
check the directory supplied is sensible and not a
security risk
become a d
b daemon process
ignore child programs (to avoid zombies when child
processes stop)
create a socket, bind it to a p
, port number and start
listening to the socket
forever {
wait and accept incoming socket connection
fork a child process
if the child process then call the web function
else close new connection
}
}
Web Server Using C Language 11
12. System Calls
Various system calls involved in request/response processes both at client
Various system calls involved in request/response processes both at client
and server side are as follows:
Server Parent Client
socket():Service socket():Service
bind():Port number connect():Start
listen():ready write() & read()
forever
{
accept():wait for request
fork():create child Server Child
} write() & read()
write() & read()
Web Server Using C Language 12
13. Socket System Calls
The socket() bind() listen() and accept() network system calls all work
socket(), bind(), listen(),
together to create a server process. They set up a socket ready for use to
communicate over a network when combined. A socket is:
An input and output stream ‐‐ regular pipes and files, for example.
Remote access to or from a server ‐‐ when used over a network.
Bidirectional ‐‐ when you read and write the same socket at both ends.
Regular read and write functions ‐‐ used to send and receive data.
A stream (no natural structure) ‐‐ you have to decide the protocol.
A stream (no natural structure) you have to decide the protocol
For HTTP ‐‐ the request message and response message are finished with a
carriage return (CR or /r in C code) and a line feed (LF and /n in C code). The
URL is terminated by a space character and the end of the requested file is
highlighted by closing the socket. There are more complex alternatives in
HTTP and many optional features, but this is the simplest way to do it.
Web Server Using C Language 13
14. Socket System Calls : socket()
The socket() function creates the socket and returns the file descriptor which
descriptor,
can be used with any function that uses file descriptors, such as read, write,
and close. The arguments tell the operating system what type of socket and
communication you need.
/* Create socket */
listener = socket(AF_INET, SOCK_STREAM, 0)
Note:‐
listener is an integer type variable
listener is an integer type variable
AF_INET, SOCK_STREAM are constants
Web Server Using C Language 14
15. Socket System Calls : bind()
The bind() function attaches a particular port number to the socket When a
socket.
client is trying to contact your server, it will use the IP address (often found by
using a DNS service to convert a hostname to an IP address) and the port
number. The port number tells the operating system which service you want
on the server.
/* Assign socket address to socket */
bind(listener, (struct sockaddr *) &servaddr, sizeof(servaddr)
Note:‐
sockaddr is a struct defined in socket h
is a struct defined in socket.h
servaddr is struct type variable of sockaddr_in
Web Server Using C Language 15
16. Socket System Calls : listen()
The listen() function call tells the operating system you are now ready to
accept incoming requests. This is the final switch that makes the socket
available to local and remote programs.
/* Make socket a listening socket */
listen(listener, LISTENQ)
Note:‐
LISTENQ is a constant
LISTENQ is a constant
Web Server Using C Language 16
17. Socket System Calls : accept()
The accept() function does not return to your program until there is a socket
connection request to this IP address and port number. The accept() function
uses the file descriptor of the socket, but a new structure for the incoming
connection (struct sockaddr in) allows a server to check who is connecting to
sockaddr_in)
it.
/* Wait for connection */
(conn = accept(listener, NULL, NULL)
Note:‐
conn is an integer type variable
is an integer type variable
Web Server Using C Language 17
18. Other System Calls
The fork() open() read() write() and close() are some other system calls
fork(), open(), read(),
used for some other jobs. Fork() is used to create a sub process or a child
process. Open(), read() and write() is work with the requested file by the
client. Close() is used to close the open connections.
Web Server Using C Language 18
19. Other System Calls:fork()
Starts a child process In the parent it returns the process id (PID) of the
process. parent,
child, and in the child, it returns zero.
/* Fork child process to service connection */
pid = fork()
Note:‐
pid is an integer type variable
is an integer type variable
Web Server Using C Language 19
20. Other System Calls:open()
It is used to open the requested file by the client
client.
/* Open the directory server_root */
open(server_root, O_RDONLY);
Note:‐
Server_root is a constant specifying the root directory.
Server root is a constant specifying the root directory
O_RDONLY is a open mode.
Web Server Using C Language 20
21. Other System Calls:read()
It is used to read the requested file by the client It is used by both client as
client.
well as server to read files.
/* Reading the resource*/
read(resource, &c, 1))
Note:‐
Resouce is a contant specifying the resource name
is a contant specifying the resource name
c is char type variable
1 is the read mode Web Server Using C Language 21
22. Other System Calls:write()
It is used to write the requested file by the client It is used by both client as
client.
well as server to write files.
/* Writing to the connection */
write(conn, &c, 1)
Note:‐
conn is an integer type constant representing accepted connection
is an integer type constant representing accepted connection.
c is char type variable
1 is the read mode Web Server Using C Language 22
23. Other System Calls:close()
It is used to close the listening socket and connected socket
socket.
/* Close listening socket*/
close(listener)
/* Close connected socket and exit */
close(conn)
Web Server Using C Language 23
24. Sample TCP Client/Server Session
Various socket system calls called at both server and client at different levels
are shown below:
Iterative Server
socket() Remote Client
bind() socket()
listen() gethostbyname()
accept() connect()
recv()/send() recv()/send()
close() close()
Web Server Using C Language 24