1)Building a MultiThreaded Web Server
In this lab we will develop a Web server in two steps. In the end, you will have built a multithreaded
Web server that is capable of processing multiple simultaneous service requests in parallel. 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 multithreaded.
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 multithreaded
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. But 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 multithreaded,
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 that 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(String argv[]) throws Exception
{
. . .
}
}
final class HttpRequest implements Runnable
{
. . .
}
Normally, Web servers process service requests that they receive thr ...
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.
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.
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 <.
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 provides an overview of using Swift to connect to networked APIs. It defines what a networked API is and describes two common API styles: RPC and REST. It then discusses REST APIs in more detail, covering the Richardson Maturity Model, HATEOAS, and Fielding's requirements for REST. The document demonstrates making HTTP requests in Swift, including preparing URLs and requests, performing requests, and handling authorization. It also briefly discusses Protocol Buffers and building gRPC services in Swift.
How a network connection is created A network connection is initi.pdfarccreation001
How a network connection is created ?
A network connection is initiated by a client program when it creates a socket for the
communication with the server. To create the socket in Java, the client calls the Socket
constructor and passes the server address and the the specific server port number to it. At this
stage the server must be started on the machine having the specified address and listening for
connections on its specific port number.
The server uses a specific port dedicated only to listening for connection requests from clients. It
can not use this specific port for data communication with the clients because the server must be
able to accept the client connection at any instant. So, its specific port is dedicated only to
listening for new connection requests. The server side socket associated with specific port is
called server socket. When a connection request arrives on this socket from the client side, the
client and the server establish a connection. This connection is established as follows:
The java.net package in the Java development environment provides the class Socket that
implements the client side and the class serverSocket class that implements the server side
sockets.
The client and the server must agree on a protocol. They must agree on the language of the
information transferred back and forth through the socket. There are two communication
protocols :
The stream communication protocol is known as TCP (transfer control protocol). TCP is a
connection-oriented protocol. It works as described in this document. In order to communicate
over the TCP protocol, a connection must first be established between two sockets. While one of
the sockets listens for a connection request (server), the other asks for a connection (client). Once
the two sockets are connected, they can be used to transmit and/or to receive data. When we say
\"two sockets are connected\" we mean the fact that the server accepted a connection. As it was
explained above the server creates a new local socket for the new connection. The process of the
new local socket creation, however, is transparent for the client.
The datagram communication protocol, known as UDP (user datagram protocol), is a
connectionless protocol. No connection is established before sending the data. The data are sent
in a packet called datagram. The datagram is sent like a request for establishing a connection.
However, the datagram contains not only the addresses, it contains the user data also. Once it
arrives to the destination the user data are read by the remote application and no connection is
established. This protocol requires that each time a datagram is sent, the local socket and the
remote socket addresses must also be sent in the datagram. These addresses are sent in each
datagram.
The java.net package in the Java development environment provides the class DatagramSocket
for programming datagram communications.
UDP is an unreliable protocol. There is no guarantee that the .
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.
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.
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 <.
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 provides an overview of using Swift to connect to networked APIs. It defines what a networked API is and describes two common API styles: RPC and REST. It then discusses REST APIs in more detail, covering the Richardson Maturity Model, HATEOAS, and Fielding's requirements for REST. The document demonstrates making HTTP requests in Swift, including preparing URLs and requests, performing requests, and handling authorization. It also briefly discusses Protocol Buffers and building gRPC services in Swift.
How a network connection is created A network connection is initi.pdfarccreation001
How a network connection is created ?
A network connection is initiated by a client program when it creates a socket for the
communication with the server. To create the socket in Java, the client calls the Socket
constructor and passes the server address and the the specific server port number to it. At this
stage the server must be started on the machine having the specified address and listening for
connections on its specific port number.
The server uses a specific port dedicated only to listening for connection requests from clients. It
can not use this specific port for data communication with the clients because the server must be
able to accept the client connection at any instant. So, its specific port is dedicated only to
listening for new connection requests. The server side socket associated with specific port is
called server socket. When a connection request arrives on this socket from the client side, the
client and the server establish a connection. This connection is established as follows:
The java.net package in the Java development environment provides the class Socket that
implements the client side and the class serverSocket class that implements the server side
sockets.
The client and the server must agree on a protocol. They must agree on the language of the
information transferred back and forth through the socket. There are two communication
protocols :
The stream communication protocol is known as TCP (transfer control protocol). TCP is a
connection-oriented protocol. It works as described in this document. In order to communicate
over the TCP protocol, a connection must first be established between two sockets. While one of
the sockets listens for a connection request (server), the other asks for a connection (client). Once
the two sockets are connected, they can be used to transmit and/or to receive data. When we say
\"two sockets are connected\" we mean the fact that the server accepted a connection. As it was
explained above the server creates a new local socket for the new connection. The process of the
new local socket creation, however, is transparent for the client.
The datagram communication protocol, known as UDP (user datagram protocol), is a
connectionless protocol. No connection is established before sending the data. The data are sent
in a packet called datagram. The datagram is sent like a request for establishing a connection.
However, the datagram contains not only the addresses, it contains the user data also. Once it
arrives to the destination the user data are read by the remote application and no connection is
established. This protocol requires that each time a datagram is sent, the local socket and the
remote socket addresses must also be sent in the datagram. These addresses are sent in each
datagram.
The java.net package in the Java development environment provides the class DatagramSocket
for programming datagram communications.
UDP is an unreliable protocol. There is no guarantee that the .
The Java Mail Server project allows clients to connect to a mail server to send and receive emails and attachments. The project is divided into three modules: a server module that uses server sockets to accept client connections, a client module that uses sockets to connect to the server, and an email inbox module that handles mail functions like forwarding, viewing attachments, and saving emails. The server stores details of client connections, mail sending and receiving. Clients can connect when the server is active to exchange emails with other clients. Usernames and passwords are stored in data files rather than a SQL server. The project provides automatic threading to handle socket connections and includes features for reliable TCP communication between clients.
1. Sockets provide a connection between client and server programs that allows them to communicate over a network. A socket is bound to each end of the connection.
2. The Socket class implements client sockets and allows a client program to connect to a server, send and receive data, and close the connection. The ServerSocket class allows a server program to listen for connections on a port and accept sockets from clients.
3. When a client connects to a server, the server accepts the connection using ServerSocket and returns a Socket. The client and server can then communicate by getting input and output streams from the socket to send data over the connection according to the network protocol.
The document discusses network programming and Java sockets. It introduces elements of client-server computing including networking basics like TCP, UDP and ports. It then covers Java sockets, explaining how to implement both a server and client using Java sockets. Code examples are provided of a simple server and client. The conclusion emphasizes that Java makes socket programming easier than other languages like C.
This document provides a tutorial on network programming in Java. It introduces Java network programming and the HTTP protocol. It discusses how Java uses sockets to establish connections between clients and servers. It also describes the Java URL class, which makes it easier to work with HTTP connections by abstracting away the low-level socket implementation. The tutorial provides examples of both an HTTP client and server implemented in Java using sockets and the URL class.
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.
This document describes how to create a simple chat room using Python sockets and threading. It involves running a server script that initializes a socket to listen for client connections on a specified port. When a client connects, the server creates a thread to handle communication with that client. The client script connects to the server socket and allows sending and receiving messages that are broadcast to all connected clients. The chat room can be used locally on a private network or accessed remotely over the internet using port forwarding.
Server side programs can be written using different server-side technologies , such as Common Gateway Interface (CGI) , Active Server Pages (ASP) and Servlets.
CGI scripts are written in C , C++ or perl programming languages .
In case of an application server using CGI script to process client request , the server creates a separate instance of the CGI script to process the request.
As a result, the efficiency of the server is affected when there is large number of concurrent requests.
The document discusses web services and introduces key concepts like SOAP, WSDL, UDDI, port types, bindings and more. It uses a sample web service that concatenates two strings as an example to explain different styles of web services including RPC style and document style. It describes how operations, messages and parts are defined for the sample web service in both styles.
A socket is an endpoint for communication between two programs over a network. It represents a connection between a client program and a server program. The server runs on a specific machine and port, listening for connection requests from clients. Clients know the server's hostname and port number to request a connection. If accepted, the server gets a new socket to communicate with that client while listening for new connections, and the client can use its socket to communicate with the server. Sockets are identified by their paired IP addresses and port numbers to allow multiple connections. The Java Socket class implements sockets to allow platform-independent network communication between Java programs.
This document discusses network programming and Java sockets. It begins with an introduction to client-server computing and networking basics like TCP, UDP, and ports. It then covers Java sockets in detail, including how to implement a server that can accept multiple clients by creating a new thread for each, and how to implement a client. Sample code is provided for a simple single-threaded server and client. The document concludes that programming client-server applications in Java using sockets is easier than in other languages like C.
Networking in java, Advanced programmingGera Paulos
This document provides an overview of networking concepts in Java. It discusses how Java makes network programming easier than C/C++. The java.net package contains classes and interfaces that handle low-level communication details. It supports both TCP and UDP network protocols. The document demonstrates how to create servers and sockets in Java to establish connections between clients and servers for communication. It also shows how to manipulate URLs to access resources on the web and process URL components.
This document provides an overview of networking concepts in Java including TCP/IP and UDP protocols, internet addressing, sockets, URLs, and how to implement client-server communication using TCP and UDP sockets. Key topics covered include the difference between TCP and UDP, how sockets connect applications to networks, internet addressing with IPv4 and IPv6, and examples of writing basic TCP and UDP client-server programs in Java.
The document provides an overview of object oriented programming and network programming concepts. It discusses topics like IP addresses, ports, sockets, client-server programming, and the java.net and java.util packages. The java.net package contains classes for network programming in Java like Socket, ServerSocket, URL, and InetAddress. The java.util package contains general-purpose utility classes like ArrayList, HashMap, Properties and Date.
The document discusses security vulnerabilities in a simple Java web server code example. It shows how an attacker could cause a denial of service attack by sending a malformed HTTP request. To prevent this, the code needs to handle exceptions carefully by disconnecting from any client that sends a malformed request. The document also emphasizes the importance of careful exception handling in building security into applications from the start.
Old Java lectures by my teacher Karim Zebari at Software Department College of Engineering University of Salahaddin-Erbil. The topics are:
- Multithreading
- Security in Java
- Java Beans
- Internationalization
- Java Servlets
- Java Server Pages
- Database access in Java
- More GUI Components & Printing
- Remote Method Invocation (RMI)
- Java Collections Framework
The Presentation given at Guru Gobind Singh Polytechnic, Nashik for Third Year Information Technology and Computer Engineering Students on 08/02/2011.
Topic: Java Network Programming
The document discusses different types of sockets in Java network programming:
- TCP/IP client socket and TCP/IP server socket are used for reliable, bidirectional stream-based connections between hosts using TCP/IP. The client socket connects to the server socket.
- A Java DatagramSocket class represents a connectionless socket for sending and receiving datagram packets without reliability or sequencing. Commonly used DatagramSocket constructors are described.
- An example program is provided to demonstrate passing a message from a server to a client using sockets, showing the client and server code.
A socket represents a connection between two programs on a network and allows them to communicate. The document discusses sockets and how they enable client-server applications like a chat application. It provides code examples of how a chat client would connect to and send messages to a chat server, which would listen for incoming connections and send messages to connected clients. The key aspects are that the server binds to a port and listens for clients to connect, and then messages can be sent bidirectionally between the client and server over their socket connection.
Choose one public organization, either from your course project, you.docxAgripinaBeaulieuyw
Choose one public organization, either from your course project, your workplace, or the literature. Analyze the culture and progress toward managed diversity in this organization. Describe the traits and characteristics of diversity within this organization. What leadership techniques would you, as the administrator, engage to promote a more diverse organization?
.
Choose one of questions and finish the report form. No Plagia.docxAgripinaBeaulieuyw
This document provides three potential topics for a one page report: 1) New graphic technologies, their adoption, and how they transformed understanding of reality; 2) How the Rural Cemetery Movement impacted 19th century urban worldviews and the role of the creative sector; 3) How commodification of the everyday impacted how people thought about themselves, others, and their communities. The document instructs the reader to choose one topic and complete a one page report form without plagiarizing.
More Related Content
Similar to 1)Building a MultiThreaded Web ServerIn this lab we will devel
The Java Mail Server project allows clients to connect to a mail server to send and receive emails and attachments. The project is divided into three modules: a server module that uses server sockets to accept client connections, a client module that uses sockets to connect to the server, and an email inbox module that handles mail functions like forwarding, viewing attachments, and saving emails. The server stores details of client connections, mail sending and receiving. Clients can connect when the server is active to exchange emails with other clients. Usernames and passwords are stored in data files rather than a SQL server. The project provides automatic threading to handle socket connections and includes features for reliable TCP communication between clients.
1. Sockets provide a connection between client and server programs that allows them to communicate over a network. A socket is bound to each end of the connection.
2. The Socket class implements client sockets and allows a client program to connect to a server, send and receive data, and close the connection. The ServerSocket class allows a server program to listen for connections on a port and accept sockets from clients.
3. When a client connects to a server, the server accepts the connection using ServerSocket and returns a Socket. The client and server can then communicate by getting input and output streams from the socket to send data over the connection according to the network protocol.
The document discusses network programming and Java sockets. It introduces elements of client-server computing including networking basics like TCP, UDP and ports. It then covers Java sockets, explaining how to implement both a server and client using Java sockets. Code examples are provided of a simple server and client. The conclusion emphasizes that Java makes socket programming easier than other languages like C.
This document provides a tutorial on network programming in Java. It introduces Java network programming and the HTTP protocol. It discusses how Java uses sockets to establish connections between clients and servers. It also describes the Java URL class, which makes it easier to work with HTTP connections by abstracting away the low-level socket implementation. The tutorial provides examples of both an HTTP client and server implemented in Java using sockets and the URL class.
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.
This document describes how to create a simple chat room using Python sockets and threading. It involves running a server script that initializes a socket to listen for client connections on a specified port. When a client connects, the server creates a thread to handle communication with that client. The client script connects to the server socket and allows sending and receiving messages that are broadcast to all connected clients. The chat room can be used locally on a private network or accessed remotely over the internet using port forwarding.
Server side programs can be written using different server-side technologies , such as Common Gateway Interface (CGI) , Active Server Pages (ASP) and Servlets.
CGI scripts are written in C , C++ or perl programming languages .
In case of an application server using CGI script to process client request , the server creates a separate instance of the CGI script to process the request.
As a result, the efficiency of the server is affected when there is large number of concurrent requests.
The document discusses web services and introduces key concepts like SOAP, WSDL, UDDI, port types, bindings and more. It uses a sample web service that concatenates two strings as an example to explain different styles of web services including RPC style and document style. It describes how operations, messages and parts are defined for the sample web service in both styles.
A socket is an endpoint for communication between two programs over a network. It represents a connection between a client program and a server program. The server runs on a specific machine and port, listening for connection requests from clients. Clients know the server's hostname and port number to request a connection. If accepted, the server gets a new socket to communicate with that client while listening for new connections, and the client can use its socket to communicate with the server. Sockets are identified by their paired IP addresses and port numbers to allow multiple connections. The Java Socket class implements sockets to allow platform-independent network communication between Java programs.
This document discusses network programming and Java sockets. It begins with an introduction to client-server computing and networking basics like TCP, UDP, and ports. It then covers Java sockets in detail, including how to implement a server that can accept multiple clients by creating a new thread for each, and how to implement a client. Sample code is provided for a simple single-threaded server and client. The document concludes that programming client-server applications in Java using sockets is easier than in other languages like C.
Networking in java, Advanced programmingGera Paulos
This document provides an overview of networking concepts in Java. It discusses how Java makes network programming easier than C/C++. The java.net package contains classes and interfaces that handle low-level communication details. It supports both TCP and UDP network protocols. The document demonstrates how to create servers and sockets in Java to establish connections between clients and servers for communication. It also shows how to manipulate URLs to access resources on the web and process URL components.
This document provides an overview of networking concepts in Java including TCP/IP and UDP protocols, internet addressing, sockets, URLs, and how to implement client-server communication using TCP and UDP sockets. Key topics covered include the difference between TCP and UDP, how sockets connect applications to networks, internet addressing with IPv4 and IPv6, and examples of writing basic TCP and UDP client-server programs in Java.
The document provides an overview of object oriented programming and network programming concepts. It discusses topics like IP addresses, ports, sockets, client-server programming, and the java.net and java.util packages. The java.net package contains classes for network programming in Java like Socket, ServerSocket, URL, and InetAddress. The java.util package contains general-purpose utility classes like ArrayList, HashMap, Properties and Date.
The document discusses security vulnerabilities in a simple Java web server code example. It shows how an attacker could cause a denial of service attack by sending a malformed HTTP request. To prevent this, the code needs to handle exceptions carefully by disconnecting from any client that sends a malformed request. The document also emphasizes the importance of careful exception handling in building security into applications from the start.
Old Java lectures by my teacher Karim Zebari at Software Department College of Engineering University of Salahaddin-Erbil. The topics are:
- Multithreading
- Security in Java
- Java Beans
- Internationalization
- Java Servlets
- Java Server Pages
- Database access in Java
- More GUI Components & Printing
- Remote Method Invocation (RMI)
- Java Collections Framework
The Presentation given at Guru Gobind Singh Polytechnic, Nashik for Third Year Information Technology and Computer Engineering Students on 08/02/2011.
Topic: Java Network Programming
The document discusses different types of sockets in Java network programming:
- TCP/IP client socket and TCP/IP server socket are used for reliable, bidirectional stream-based connections between hosts using TCP/IP. The client socket connects to the server socket.
- A Java DatagramSocket class represents a connectionless socket for sending and receiving datagram packets without reliability or sequencing. Commonly used DatagramSocket constructors are described.
- An example program is provided to demonstrate passing a message from a server to a client using sockets, showing the client and server code.
A socket represents a connection between two programs on a network and allows them to communicate. The document discusses sockets and how they enable client-server applications like a chat application. It provides code examples of how a chat client would connect to and send messages to a chat server, which would listen for incoming connections and send messages to connected clients. The key aspects are that the server binds to a port and listens for clients to connect, and then messages can be sent bidirectionally between the client and server over their socket connection.
Similar to 1)Building a MultiThreaded Web ServerIn this lab we will devel (20)
Choose one public organization, either from your course project, you.docxAgripinaBeaulieuyw
Choose one public organization, either from your course project, your workplace, or the literature. Analyze the culture and progress toward managed diversity in this organization. Describe the traits and characteristics of diversity within this organization. What leadership techniques would you, as the administrator, engage to promote a more diverse organization?
.
Choose one of questions and finish the report form. No Plagia.docxAgripinaBeaulieuyw
This document provides three potential topics for a one page report: 1) New graphic technologies, their adoption, and how they transformed understanding of reality; 2) How the Rural Cemetery Movement impacted 19th century urban worldviews and the role of the creative sector; 3) How commodification of the everyday impacted how people thought about themselves, others, and their communities. The document instructs the reader to choose one topic and complete a one page report form without plagiarizing.
Choose one culture Egyptian (egypt) Write a response t.docxAgripinaBeaulieuyw
Choose one culture
Egyptian (egypt)
Write a response to the following question:
How does the culture of the people influence their architecture?
What does the architecture tell you about the culture? (The material used, the size, the intended function, did they decorate it, etc,). 150 words
DUE DATE 11-16-2016 BY NOON
APA FORMAT
.
Choose one of the four major theories of happiness Hedonism, Epicur.docxAgripinaBeaulieuyw
Choose one of the four major theories of happiness: Hedonism, Epicureanism, Stoicism, or Aristotle's view, and describe the following aspects of the theory in a 1-2 page Word document:
Offer a brief explanation of the history of the theory.
Share the basic fundamental view of how the theory creates or explains happiness.
Offer a criticism or challenge to the theory.
Relate the theory to an example from the present day which supports and reflects this view of happiness.
Explain how you would apply this theory to your own pursuit of happiness.
APA format with 2 outside sources.
.
Choose one of the Persuasive American Speeches” listed in the Supp.docxAgripinaBeaulieuyw
Choose one of the “Persuasive American Speeches” listed in the “Supplemental Readings” section of the course lessons. Discuss purpose and the claim of the speech. Explain how the speech supports this claim (logos, ethos, and/or pathos). Is the opposing side mentioned? Also, describe the method of argumentation you believe is used in the speech (Toulmin? Rogerian? A mixture of both?). Give citations to back up your points, and create a final works cited citation for this essay.
Instructions: Your initial discussion should be at least 200 words. It must include MLA citations – both in-text and an end citation.
Eisenhower, Dwight. “Farewell Speech.”
Kennedy Assassination Home Page.
n.d. Web. 11
May 2012.
.
Choose one of the following artists for an examination of their st.docxAgripinaBeaulieuyw
Choose
one of the following artists for an examination of their stylistic development into abstraction:
Arthur Dove
Stanton Macdonald-Wright
Marsden Hartley
Max Weber
Georgia O'Keeffe
Write
a 700- to 1,050-word paper examining your selected artist's development into abstraction that responds to the following:
How and why did early American abstraction develop?
What subjects were present in your artist's abstract works? Describe with at least one example from the artist.
Why did the artists choose to work in this style? To what influences were they responding to from Europe, and how was their own exploration of abstraction meaningful to them?
What is your own response to the artist's work?
Format
your paper according to appropriate course level APA guidelines.
Submit
your assignment to the Assignment Files tab.
.
Choose one ecosystem that interests you. Use the library, Internet a.docxAgripinaBeaulieuyw
Choose one ecosystem that interests you. Use the library, Internet and other credible resources to create a 7-9 slide PowerPoint presentation exploring the ecosystem you selected.
Include images of organisms, plants, animals and discuss how they coexist.
In your presentation, include a minimum of one slide that addresses the level of human impact on the ecosystem. Has this human impact negatively affected the ecosystem? How?
Include at least one slide that discusses the future health and longevity of the ecosystem you selected.
.
Choose one culture that has been discussed in the lesson or that has.docxAgripinaBeaulieuyw
Mesopotamian culture influenced their architecture. Their architecture used mud bricks and wood due to the lack of stone in the region. The architecture included ziggurats, temples, and palaces that showed their emphasis on religion and centralized government through their size and decoration.
Choose one peer reviewed article that related to E-Commerce and answ.docxAgripinaBeaulieuyw
Choose one peer reviewed article that related to E-Commerce and answer and follow the steps that in the document attached.
No paper format!! Just fill in the blanks that in the document attached.
Savicki, V., & Cooley, E. (2011). American identity in study abroad students: Contrasts, changes, correlates.
Journal of College Student Development
this one is just an example
The due tomorrow at 8:00 Am Texas time
.
Choose one of the topics below to write your literary research paper.docxAgripinaBeaulieuyw
Choose one of the topics below to write your literary research paper. Remember your paper must be at least 1200 words.
1. Discuss the relationship between Aylmer and Georgiana in "The Birthmark.". In your essay, incorporate at least one quote from the article by John J. McKenna and one quote from the article by C. R. Resetarits.
(Ideas you should consider: Why does Aylmer focus obsessively on Georgiana's birthmark? Why does Georgiana agree to participate in Aylmer's experiment? What effect does their isolation from others have on their relationship? How does their relationship critique the traditional conceptions/misconceptions of love and marriage? Whose article (McKenna's or Resetarits's) did you find most helpful? Why? Does the story suggest that science and romance are incompatible? In what way is Aylmer represent an example of the "divided self"? Can you think of any modern examples where scientists have acted in unethical, inhumane ways in the name of science? )
2. Discuss the relationship between Twyla and Roberta in "Recitatif." In your essay, incorporate at least one quote from the article by Helane Adams Androne and one quote from Marie Knoflickova.
(Ideas you should consider: What does the story suggest about believing in and/or acting on stereotypes? What does the story suggest about other forms of disunity and discrimination? What does the story suggest about abuse, especially abuse of the disenfranchised and/or disabled? What role does memory (or the suppression of it) play in their relationship? Why do Twyla and Roberta lose the bond they had?)
3.Choose
one
of the following topics for a research paper on "Sonny's Blues," and include at least one quote from the article by Donald C. Murray and one quote from the article by Keith A. Byerman.
a. How does the narrator change from the beginning of the story to the final scene? At what points in the story do you see these changes occurring? What memories, insights, and conversations does he have that facilitate his change?
(Look closely at paragraphs 177-178, 215-216, and 238.)
b. Discuss the theme of addiction in "Sonny's Blues." What causes does the narrator suggest underlie drug addiction? How does the narrator divide the responsibility for drug addiction in his characters?
In other words, how much does addiction seem to be the result of large, endemic, social problems and how much by family and personal issues? In this story, what resources help Sonny overcome the pull of his addiction and remain a recovering addict? (Look closely at paragraphs 75-80, 190-200, and 215-225.)
c. Discuss the theme of music in the story. What importance does music serve in the lives of Baldwin's characters? (Look closely at paragraphs 180-181 and 235-240.)
d. Discuss the theme of racism in the story. (Look especially at paragraphs 81-110)
.
Choose ONE of the following questions to answer in the Discussio.docxAgripinaBeaulieuyw
Choose
ONE
of the following questions to answer in the Discussion Board:
Have advances in modern technology expanded or contracted citizens' conceptions of what privacy they actually enjoy? Is it still reasonable to assume that conversations on cell phones remain private? What about e-mail messages and texts? Is anything that you do or write on a social networking site such as Facebook actually private?
What disadvantages do modern-day pioneers in battles over equality face? Is the fame they gain for being first worth the price they must pay from their opponents?
.
choose ONE of the discussion topics. half page, within resourceWha.docxAgripinaBeaulieuyw
Politics and religion played a major role in the European wars of the 16th century. Religious controversies over doctrinal differences led to conflicts between Catholic and Protestant states. Some of the divisions from those religious wars continue to influence Western societies today through their social and political legacies.
Choose one health care service or function from your readings or.docxAgripinaBeaulieuyw
Choose
one health care service or function from your readings or this week’s vocabulary exercise that interests you the most personally or professionally. Identify it below:
Division:
Hospice care facility
Describe
the chosen service or function of care by filling out the following. Address each point with complete, grammatically correct sentences.
Focus or mission of the service or function (100 to 200 words):
Description of the population served (100 to 200 words):
Specific care providers or professionals who work in this service or function (100 to 200 words):
How this service or function of care interacts with the health care structure in which it exists (100 to 200 words):
.
Choose from one of the 3 readings below from this week. Write .docxAgripinaBeaulieuyw
Choose from
one of the 3 readings
below from this week.
Write an essay of at least 500 words
addressing the points and questions from the readings,
" The Nature of Art"
by Stephanie Arnold,
“Art as a Human Behavior: Toward an Ethological View of Art"
by Ellen Dissanayake and
“Exploring the Relationships Between Art and Culture”
by McFee and Degge. Be certain to address points made by the authors particularly as they pertain to your personal experience with various art forms.
Post your essay in Discussions under:
"
Week 1 - Readings Response Essay"
1)
From the reading,
The nature of Art
by Stephanie Arnold, address the variety of art forms and what the author says about how the arts are "central to
life".
a - How do you see these points of discussion reflected in your own life?
b - What does the author say is the difficulty of defining art?
c - How do you respond from your personal experience to Susanne Langer's statement: "Art is
the creation of forms symbolic or expressive of human feeling."
d - How do you view art in your environment that "... deals more directly with humanity's relations
with itself, the interactions between human beings."? Give some examples from your personal
experience and perspective...
2)
Explore the points made by Ellen Dissanayake in (
“Art as a Human Behavior").
Discuss her view of art's role in human cultural development.
a - Describe specific points made by Dissanayake and share from your perspective and cultural
background if you agree or disagree with the author. Tell us Why?
b - Choose points made by the author that have significance to you.
c - Some examples of points you may choose to address are as follows: “Art, ...as a universal need
and propensity of the human species”, “Art as a behavior of making special”, and “ The species-
centered view of art.”
3)
What points do McFee and Degge make with regard to the role of art in culture?
a - Describe specific points made by McFee, Degge, and share from your perspective and cultural
background if you agree or disagree with the authors. Tell us Why?
b - Choose points made by the authors that have significance to you. Some examples of points you
may choose to address are as follows: “Art as Communication”, “Defining and Evaluating
Art”, “Understanding Culture” and “Learning Culture”, “Visual Communication and Predictability?
And Art as Enhancement”, and/or “Making Culturally Relevant Art Judgments.”
.
Choose from 1 of the following as an essay choiceCompare and co.docxAgripinaBeaulieuyw
The document provides instructions for a midterm essay assignment. Students must choose one of three essay prompts about strategy and tactics in World War II. The essay must be 3 pages minimum, include at least 3 scholarly sources, use correct Turabian formatting, and be original work without plagiarism. It will be evaluated on organization, major points, historical examples, formatting, and grammar. Areas of evaluation include clarity of thesis, structure and length of the paper, logical major points, accurate and relevant examples, proper citations and bibliography, and standard grammar.
Human: You are an expert at summarizing documents. You provide concise summaries in 3 sentences or less that provide the high level and essential information from the document.
Choose any two philosophers we’ve considered and imagine them squari.docxAgripinaBeaulieuyw
Choose any two philosophers we’ve considered and imagine them squaring off (that is, contrast their points of view) on either a philosophical issue or some important current event.
philosopher we studied: plato, artistotle, decrates, socrates.. Must be organized and clear. Use of standard written English is expected.
.
Choose either Option A or Option B. Formulate an initial post in whi.docxAgripinaBeaulieuyw
Choose either Option A or Option B. Formulate an initial post in which you address the points noted in the prompt for your chosen option.
Optionon A: Assimilation
The textbook discusses the process of assimilation. After viewing the film,
Indian School: Stories of Survival
, answer the following questions:
What is the definition of
assimilation
according to your textbook?
What were you most surprised to learn from the film?
Why did the American government decide to assimilate Native American children into Western culture?
How did this affect them long term?
Is assimilating others into another culture ever justified?
Option B: Cultural Relativism
Cultural relativism asserts that every culture has its own set of customs and beliefs, and that culture must be understood by the standards and values of the people within that culture. Anthropologists think that what might seem cruel or irrational in our own culture must be seen through the lens of cultural relativity, and that all cultures have practices or beliefs that can be seen by others as repugnant or incomprehensible.
After reading
The Universal Declaration of Human Rights
, explain whether you think cultural relativism can coexist with the idea of universal human rights. Is it possible for anthropologists to promote human rights without imposing their own values and ideas of human rights? Explain your position.
Your initial post should be at least 250 words in length. Support your claims with examples from the required materials and/or other scholarly sources. Cite your sources in the body of your post and provide a complete reference for each source used at the end of it.
ATTACHED ARE THE CHAPTERS AND OTHER RESOURCES NEEDED TO COMPLETE THIS. ALSO ATTACHED ARE THE EXPECTATIONS OF WHAT SHOULD BE DONE. ALL POINTS OF THE DISCUSSION MUST BE COVERED.
.
Choose an artist, from the website beinart.org, and describe their w.docxAgripinaBeaulieuyw
Choose an artist, from the website beinart.org, and describe their work using a descriptive formal vocabulary. Choose one piece in specific to write a critical analysis. Include information about the artist's style. Be sure to mention the artist you chose and the title of the piece you're writing about.
.
Choose an Emerging Infectious Disease (EID) to discuss.300-400 wor.docxAgripinaBeaulieuyw
Choose an Emerging Infectious Disease (EID) to discuss.
300-400 words
about the emerging disease.
.
.
.
.
.
.
.
Do NOT choose any diseases from the list below!!!
Chikungunya Virus
Cyclospora cayetanensis
Dengue Virus
Ebola Virus
Haemophilus influenzae
Helicobacter pylori
Herpes Simplex Virus
Human Immunodeficiency Virus
Influenza Virus, Avian Strain
Lassa Virus
Middle Eastern Respiratory Syndrome Coronavirus
Severe Acute Respiratory Syndrome Coronavirus
Staphylococcus aureus, Methicillin Resistant
Varicella Zoster Virus
Zika Virus
Hepatitis C
You must include what type of disease it is, what microorganism causes it, where in the world it is found, when it was discovered, where/when it has newly emerged, how it is isolated/diagnosed in the lab, how it is treated and any other interesting information about the pathogen. You must paraphrase and cite your credible academic sources via in text citation and full reference information in APA format.
Need completed today at 6:00PM Central USA Time!
.
Choose a work of Rococo or Neoclassical art and relate it to a c.docxAgripinaBeaulieuyw
This document asks the reader to choose a work of either Rococo or Neoclassical art, relate it to a contemporary work or social construct, and discuss any shared ideals or values expressed in both the historical art and modern society. The reader must include an image of the chosen artwork and a one paragraph analysis.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
1)Building a MultiThreaded Web ServerIn this lab we will devel
1. 1)Building a MultiThreaded Web Server
In this lab we will develop a Web server in two steps. In the
end, you will have built a multithreaded
Web server that is capable of processing multiple simultaneous
service requests in parallel. 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 multithreaded.
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 multithreaded
server that simply displays the contents of the HTTP request
message that it
receives. After this program is running properly, you will add
2. the code required to generate an appropriate response.
As you are developing the code, you can test your server from a
Web browser. But 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.
3. Our first implementation of the Web server will be
multithreaded,
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 that 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(String argv[]) throws Exception
{
. . .
4. }
}
final class HttpRequest implements Runnable
{
. . .
}
Normally, Web servers process service requests that they
receive through wellknown port number 80. You can choose any
port higher than 1024, but remember to use the same port
number when making requests to your Web
server from your browser.
public static void main(String argv[]) throws Exception
{
// Set the port number.
int port = 6789;
. . .
}
Next, we open a socket and wait for a TCP connection request.
Because we will be servicing request messages
5. indefinitely, we place the listen operation inside of an infinite
loop. This means we will have to terminate the Web
server by pressing ^C on the keyboard.
// Establish the listen socket.
?
// Process HTTP service requests in an infinite loop.
while (true) {
// Listen for a TCP connection request.
?
. . .
}
When a connection request is received, we create an
HttpRequest object, passing to its constructor a reference to
the Socket object that represents our established connection
with the client.
// Construct an object to process the HTTP request message.
HttpRequest request = new HttpRequest( ? );
6. // Create a new thread to process the request.
Thread thread = new Thread(request);
// Start the thread.
thread.start();
In order to have the HttpRequest object handle the incoming
HTTP service request in a separate thread, we first
create a new Thread object, passing to its constructor a
reference to the HttpRequest object, and then call the
thread's start() method.
After the new thread has been created and started, execution in
the main thread returns to the top of the message
processing loop. The main thread will then block, waiting for
another TCP connection request, while the new thread
continues running. When another TCP connection request is
received, the main thread goes through the same
process of thread creation regardless of whether the previous
thread has finished execution or is still running.
This completes the code in main(). For the remainder of the lab,
it remains to develop the HttpRequest class.
7. We declare two variables for the HttpRequest class: CRLF and
socket. According to the HTTP specification, we
need to terminate each line of the server's response message
with a carriage return (CR) and a line feed (LF), so we
have defined CRLF as a convenience. The variable socket will
be used to store a reference to the connection
socket, which is passed to the constructor of this class. The
structure of the HttpRequest class is shown below:
final class HttpRequest implements Runnable
{
final static String CRLF = "rn";
Socket socket;
// Constructor
public HttpRequest(Socket socket) throws Exception
{
this.socket = socket;
}
// Implement the run() method of the Runnable interface.
8. public void run()
{
. . .
}
private void processRequest() throws Exception
{
. . .
}
}
In order to pass an instance of the HttpRequest class to the
Thread's constructor, HttpRequest must implement
the Runnable interface, which simply means that we must define
a public method called run() that returns void.
Most of the processing will take place within processRequest(),
which is called from within run().
Up until this point, we have been throwing exceptions, rather
than catching them. However, we can not throw
exceptions from run(), because we must strictly adhere to the
declaration of run() in the Runnable interface,
which does not throw any exceptions. We will place all the
9. processing code in processRequest(), and from there,
throw exceptions to run(). Within run(), we explicitly catch and
handle exceptions with a try/catch block.
// Implement the run() method of the Runnable interface.
public void run()
{
try {
processRequest();
} catch (Exception e) {
System.out.println(e);
}
}
Now, let's develop the code within processRequest(). We first
obtain references to the socket's input and output
streams. Then we wrap InputStreamReader and BufferedReader
filters around the input stream. However, we
won't wrap any filters around the output stream, because we will
be writing bytes directly into the output stream.
private void processRequest() throws Exception
10. {
// Get a reference to the socket's input and output streams.
InputStream is = ?;
DataOutputStream os = ?;
// Set up input stream filters.
?
BufferedReader br = ?;
. . .
}
Now we are prepared to get the client's request message, which
we do by reading from the socket's input stream.
The readLine() method of the BufferedReader class will extract
characters from the input stream until it reaches
an endofline character, or in our case, the endofline character
sequence CRLF.
The first item available in the input stream will be the HTTP
request line. (See Section 2.2 of the textbook for a
description of this and the following fields.)
11. // Get the request line of the HTTP request message.
String requestLine = ?;
// Display the request line.
System.out.println();
System.out.println(requestLine);
After obtaining the request line of the message header, we
obtain the header lines. Since we don't know ahead of
time how many header lines the client will send, we must get
these lines within a looping operation.
// Get and display the header lines.
String headerLine = null;
while ((headerLine = br.readLine()).length() != 0) {
System.out.println(headerLine);
}
We don't need the header lines, other than to print them to the
screen, so we use a temporary String variable,
headerLine, to hold a reference to their values. The loop
terminates when the expression
12. (headerLine = br.readLine()).length()
evaluates to zero, which will occur when headerLine has zero
length. This will happen when the empty line
terminating the header lines is read. (See the HTTP Request
Message diagram in Section 2.2 of the textbook)
In the next step of this lab, we will add code to analyze the
client's request message and send a response. But
before we do this, let's try compiling our program and testing it
with a browser. Add the following lines of code to
close the streams and socket connection.
// Close streams and socket.
os.close();
br.close();
socket.close();
After your program successfully compiles, run it with an
available port number, and try contacting it from a browser.
To do this, you should enter into the browser's address text box
the IP address of your running server. For example,
if your machine name is host.someschool.edu, and you ran the
13. server with port number 6789, then you would
specify the following URL:
http://host.someschool.edu:6789/
The server should display the contents of the HTTP request
message. Check that it matches the message format
shown in the HTTP Request Message diagram in Section 2.2 of
the textbook.
Web Server in Java: Part B
Instead of simply terminating the thread after displaying the
browser's HTTP request message, we will analyze the
request and send an appropriate response. We are going to
ignore the information in the header lines, and use only
the file name contained in the request line. In fact, we are going
to assume that the request line always specifies the
GET method, and ignore the fact that the client may be sending
some other type of request, such as HEAD or
POST.
We extract the file name from the request line with the aid of
the StringTokenizer class. First, we create a
14. StringTokenizer object that contains the string of characters
from the request line. Second, we skip over the
method specification, which we have assumed to be "GET".
Third, we extract the file name.
// Extract the filename from the request line.
StringTokenizer tokens = new StringTokenizer(requestLine);
tokens.nextToken(); // skip over the method, which should be
"GET"
String fileName = tokens.nextToken();
// Prepend a "." so that file request is within the current
directory.
fileName = "." + fileName;
Because the browser precedes the filename with a slash, we
prefix a dot so that the resulting pathname starts
within the current directory.
Now that we have the file name, we can open the file as the first
step in sending it to the client. If the file does not
exist, the FileInputStream() constructor will throw the
FileNotFoundException. Instead of throwing this possible
exception and terminating the thread, we will use a try/catch
construction to set the boolean variable
15. fileExists to false. Later in the code, we will use this flag to
construct an error response message, rather than try
to send a nonexistent file.
// Open the requested file.
FileInputStream fis = null;
boolean fileExists = true;
try {
fis = new FileInputStream(fileName);
} catch (FileNotFoundException e) {
fileExists = false;
}
There are three parts to the response message: the status line,
the response headers, and the entity body. The
status line and response headers are terminated by the character
sequence CRLF. We are going to respond with a
status line, which we store in the variable statusLine, and a
single response header, which we store in the
variable contentTypeLine. In the case of a request for a
nonexistent file, we return 404 Not Found in the status
16. line of the response message, and include an error message in
the form of an HTML document in the entity body.
// Construct the response message.
String statusLine = null;
String contentTypeLine = null;
String entityBody = null;
if (fileExists) {
statusLine = ?;
contentTypeLine = "Content‐ type: " +
contentType( fileName ) + CRLF;
} else {
statusLine = ?;
contentTypeLine = ?;
entityBody = "" +
"Not Found" +
"Not Found";
}
When the file exists, we need to determine the file's MIME type
17. and send the appropriate MIMEtype
specifier. We make this determination in a separate private
method called contentType(), which returns a string that we can
include in the content type line that we are constructing.
Now we can send the status line and our single header line to
the browser by writing into the socket's output
stream.
// Send the status line.
os.writeBytes(statusLine);
// Send the content type line.
os.writeBytes(?);
// Send a blank line to indicate the end of the header lines.
os.writeBytes(CRLF);
Now that the status line and header line with delimiting CRLF
have been placed into the output stream on their way
to the browser, it is time to do the same with the entity body. If
the requested file exists, we call a separate method
to send the file. If the requested file does not exist, we send the
18. HTMLencoded error message that we have prepared.
// Send the entity body.
if (fileExists) {
sendBytes(fis, os);
fis.close();
} else {
os.writeBytes(?);
}
After sending the entity body, the work in this thread has
finished, so we close the streams and socket before
terminating.
We still need to code the two methods that we have referenced
in the above code, namely, the method that
determines the MIME type, contentType(), and the method that
writes the requested file onto the socket's output
stream. Let's first take a look at the code for sending the file to
the client.
private static void sendBytes(FileInputStream fis, OutputStream
os)
19. throws Exception
{
// Construct a 1K buffer to hold bytes on their way to the
socket.
byte[] buffer = new byte[1024];
int bytes = 0;
// Copy requested file into the socket's output stream.
while((bytes = fis.read(buffer)) != ‐ 1 ) {
os.write(buffer, 0, bytes);
}
}
Both read() and write() throw exceptions. Instead of catching
these exceptions and handling them in our code,
we throw them to be handled by the calling method.
The variable, buffer, is our intermediate storage space for bytes
on their way from the file to the output stream.
When we read the bytes from the FileInputStream, we check to
see if read() returns minus one, indicating that
20. the end of the file has been reached. If the end of the file has
not been reached, read() returns the number of bytes
that have been placed into buffer. We use the write() method of
the OutputStream class to place these bytes
into the output stream, passing to it the name of the byte array,
buffer, the starting point in the array, 0, and the
number of bytes in the array to write, bytes.
The final piece of code needed to complete the Web server is a
method that will examine the extension of a file
name and return a string that represents it's MIME type. If the
file extension is unknown, we return the type
application/octet‐ stream.
private static String contentType(String fileName)
{
if(fileName.endsWith(".htm") || fileName.endsWith(".html")) {
return "text/html";
}
if(?) {
?;
21. }
if(?) {
?;
}
return "application/octet‐ stream";
}
There is a lot missing from this method. For instance, nothing is
returned for GIF or JPEG files. You may want to
add the missing file types yourself, so that the components of
your home page are sent with the content type
correctly specified in the content type header line. For GIFs the
MIME type is image/gif and for JPEGs it is
image/jpeg.
This completes the code for the second phase of development of
your Web server. Try running the server from the
directory where your home page is located, and try viewing
your home page files with a browser. Remember to
include a port specifier in the URL of your home page, so that
your browser doesn't try to connect to the default port
80. When you connect to the running web server with the
browser, examine the GET message requests that the
22. web server receives from the browser.
---------------------------------------------------------------------------
---------------------------------------------------
Socket Programming Assignment 1: Web Server
In this lab, you will learn 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.
You will develop a web server that handles one HTTP request at
a time. Your web server should accept and parse the HTTP
request, get the requested file from the server’s file system,
create an HTTP response message consisting of the requested
file preceded by header lines, and then send the response
directly to the client. If the requested file is not present in the
server, the server should send an HTTP “404 Not Found”
message back to the client.
Code
Below you will find the skeleton code for the Web server. You
are to complete the skeleton code. The places where you need to
fill in code are marked with #Fill in start and #Fill in end. Each
place may require one or more lines of code.
Running the Server
Put an HTML file (e.g., HelloWorld.html) in the same directory
that the server is in. Run the server program. Determine the IP
address of the host that is running the server (e.g.,
128.238.251.26). From another host, open a browser and
provide the corresponding URL. For example:
23. http://128.238.251.26:6789/HelloWorld.html
‘HelloWorld.html’ is the name of the file you placed in the
server directory. Note also the use of the port number after the
colon. You need to replace this port number with whatever port
you have used in the server code. In the above example, we
have used the port number 6789. The browser should then
display the contents of HelloWorld.html. If you omit ":6789",
the browser will assume port 80 and you will get the web page
from the server only if your server is listening at port 80.
Then try to get a file that is not present at the server. You
should get a “404 Not Found” message.
What to Hand in
You will hand in the complete server code along with the screen
shots of your client browser, verifying that you actually receive
the contents of the HTML file from the server.
Skeleton Python Code for the Web Server
#import socket module
from socket import *
serverSocket = socket(AF_INET, SOCK_STREAM)
#Prepare a sever socket
#Fill in start
#Fill in end
while True:
24. #Establish the connection
print 'Ready to serve...'
connectionSocket, addr = #Fill in start #Fill in end
try:
message = #Fill in start #Fill in end
filename = message.split()[1]
f = open(filename[1:])
outputdata = #Fill in start #Fill in end
#Send one HTTP header line into socket
#Fill in start
#Fill in end
#Send the content of the requested file to the client
for i in range(0, len(outputdata)):
connectionSocket.send(outputdata[i])
connectionSocket.close()
except IOError:
#Send response message for file not found
#Fill in start
25. #Fill in end
#Close client socket
#Fill in start
#Fill in end
serverSocket.close()
Optional Exercises
1. Currently, the web server handles only one HTTP request at a
time. Implement a multithreaded server that is capable of
serving multiple requests simultaneously. Using threading, first
create a main thread in which your modified server listens for
clients at a fixed port. When it receives a TCP connection
request from a client, it will set up the TCP connection through
another port and services the client request in a separate thread.
There will be a separate TCP connection in a separate thread for
each request/response pair.
2. Instead of using a browser, write your own HTTP client to
test your server. Your client will connect to the server using a
TCP connection, send an HTTP request to the server, and
display the server response as an output. You can assume that
the HTTP request sent is a GET method.
The client should take command line arguments specifying the
server IP address or host name, the port at which the server is
listening, and the path at which the requested object is stored at
the server. The following is an input command format to run the
client.
client.py server_host server_port filename