Project I - Narrative: The goal of Project I is to develop a server process that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Project I - Narrative: The goal of Project I is to develop a server process that communicates with multiple clients using sockets. The programs should be console-mode application (text-base, old MS-DOS type application) that should run on Win32 environment. The server process is supposed to be started at one of the PCs (Windows-based IBM-compatible) before any client makes a connection request to it. Client processes should be started at different PCs (for testing purpose, you can run clients and a server on the same host, but a server and clients should be able to communicate between different network hosts). The source code for client process will be provided by the instructor (Fujinoki). The client process is designed to take three parameters at the command prompt when one is started. The format of the three parameters at the command prompt is: client <CLIENT ID#> <SERVER IP ADDREES> <SERVER PORT #> Client ID: The client ID is the identification of clients that uniquely identify each of the multiple clients a server will deal with. The client ID is simply an integer (e.g., 1, 2, ...) assigned to each client that talks to the same server (therefore the same client ID can not be assigned to more than one client). Server IP address: The IP address of a server this client is going to talk to. Server Port Number: A server is listening to a particular TCP port at a network host with an IP address. In order for a client to talk to a server, both IP address and YCP port number must be specified. What this client and server application will perform: After a client process is started by entering the command shown above, the client sends a connection request (using "connect" at the client) to the server process at a specified network host computer. Then, a TCP/IP connection will be established between the server and the client. At the server side, each time the server receives a connection request from a client, the server process should display a message, "a connection request arrived!" on its local display. Then, the server process extracts the client's IP address and the TCP port number. After a socket connection is successfully established, the client process should send its client ID. The server process has a specific client called "prohibited client". The client should send its client ID to the server and the server should receive the message (i.e., the client ID) through the socket connection and display the following message, "Request from client #", where # is the ID of the client. After the server process displays the client ID, the server returns the timestamp (the timestamp at the arrival of the second message) to the requesting client if the client is not the prohibited client. If it is the prohibited client, the server returns a message for rejection ("Your access is denied by this server!") to the client, instead of the timestamp message. The server process, then, should wait for one second after it returns the timestamp to the client. The client should receive the message from the server (either timestamp or rejection message) and display it on the client's local display. After the client displays the message, the client should disconnect the socket connection and start the whole process from the beginning. Multiple clients (but up to three in this project) should be able to connect to the server at the same time (and the server 1 should be able to handle up to three clients simultaneously). Each client should be designed to repeat this procedure 15 times and after 15 repeats, it should terminate itself. For each repeat, the client process will wait about one second. In the server side, execution should go back to "accept" function call. Technical Requirements: a. Your source code file should be developed using MS Visual C++ (in Visual Studio) for IBM-compatible PCs. Due to the large class enrolment, program source code files written in any other programming language, for any other compilers, or for any other hardware platforms, will not be accepted for grading. b. c. Your server must communicate with the client (client.cpp) posted to the CS447 home and the client process can not be modified. Declaration of the prohibited client: the IP address of the prohibited client must be declared using #define declarative at the beginning of your source code file. d. The messages displayed by the client process should not contain any extra contents. e. Your server process must be ready for serving multiple clients at any time (even when a client completes, your server must be up and running, ready for other clients). (2) Connection type: connection-oriented socket (stream socket = TCP) Required Process Structure: Display: "a request arrived".. Display: "From client X" SERVER Socket Bind Listen Accept Read Write Wait 1 sec. CLIENT Socket Connect Write Read Close Wait 1 sec. End 3 clients Repeat 5 times Display: "Time: XX:XX" Project I - Narrative: The goal of Project I is to develop a server process that communicates with multiple clients using sockets. The programs should be console-mode application (text-base, old MS-DOS type application) that should run on Win32 environment. The server process is supposed to be started at one of the PCs (Windows-based IBM-compatible) before any client makes a connection request to it. Client processes should be started at different PCs (for testing purpose, you can run clients and a server on the same host, but a server and clients should be able to communicate between different network hosts). The source code for client process will be provided by the instructor (Fujinoki). The client process is designed to take three parameters at the command prompt when one is started. The format of the three parameters at the command prompt is: client <CLIENT ID#> <SERVER IP ADDREES> <SERVER PORT #> Client ID: The client ID is the identification of clients that uniquely identify each of the multiple clients a server will deal with. The client ID is simply an integer (e.g., 1, 2, ...) assigned to each client that talks to the same server (therefore the same client ID can not be assigned to more than one client). Server IP address: The IP address of a server this client is going to talk to. Server Port Number: A server is listening to a particular TCP port at a network host with an IP address. In order for a client to talk to a server, both IP address and YCP port number must be specified. What this client and server application will perform: After a client process is started by entering the command shown above, the client sends a connection request (using "connect" at the client) to the server process at a specified network host computer. Then, a TCP/IP connection will be established between the server and the client. At the server side, each time the server receives a connection request from a client, the server process should display a message, "a connection request arrived!" on its local display. Then, the server process extracts the client's IP address and the TCP port number. After a socket connection is successfully established, the client process should send its client ID. The server process has a specific client called "prohibited client". The client should send its client ID to the server and the server should receive the message (i.e., the client ID) through the socket connection and display the following message, "Request from client #", where # is the ID of the client. After the server process displays the client ID, the server returns the timestamp (the timestamp at the arrival of the second message) to the requesting client if the client is not the prohibited client. If it is the prohibited client, the server returns a message for rejection ("Your access is denied by this server!") to the client, instead of the timestamp message. The server process, then, should wait for one second after it returns the timestamp to the client. The client should receive the message from the server (either timestamp or rejection message) and display it on the client's local display. After the client displays the message, the client should disconnect the socket connection and start the whole process from the beginning. Multiple clients (but up to three in this project) should be able to connect to the server at the same time (and the server 1 should be able to handle up to three clients simultaneously). Each client should be designed to repeat this procedure 15 times and after 15 repeats, it should terminate itself. For each repeat, the client process will wait about one second. In the server side, execution should go back to "accept" function call. Technical Requirements: a. Your source code file should be developed using MS Visual C++ (in Visual Studio) for IBM-compatible PCs. Due to the large class enrolment, program source code files written in any other programming language, for any other compilers, or for any other hardware platforms, will not be accepted for grading. b. c. Your server must communicate with the client (client.cpp) posted to the CS447 home and the client process can not be modified. Declaration of the prohibited client: the IP address of the prohibited client must be declared using #define declarative at the beginning of your source code file. d. The messages displayed by the client process should not contain any extra contents. e. Your server process must be ready for serving multiple clients at any time (even when a client completes, your server must be up and running, ready for other clients). (2) Connection type: connection-oriented socket (stream socket = TCP) Required Process Structure: Display: "a request arrived".. Display: "From client X" SERVER Socket Bind Listen Accept Read Write Wait 1 sec. CLIENT Socket Connect Write Read Close Wait 1 sec. End 3 clients Repeat 5 times Display: "Time: XX:XX"
Expert Answer:
Answer rating: 100% (QA)
Answer serverc include include include include include include include void errorconst char msg perrormsg exit1 int mainint argc char argv int sockfd newsockfd portno socklent clilen char buffer256 st... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Do some amendment and enhance the given research paper: Table of Content Abstract..3 Action Research.4 Research Methodology and Design...5 Literature Review: NoSQL Database7 Proposal.7 Iteration 1..8...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Tory Company sells a single product. Troy estimates demand and costs at various activity levels as follows: How much profit will Troy have if a price of $45 is charged? Units Sold Price Total...
-
Prepare budgetary and proprietary journal entries to record the following year- end adjustments: 1. An accrual of $ 60,000 was made for salaries earned the last week of September, to be paid in...
-
In a certain suburb of Los Angeles, the level of ozone L(t) at 7:00 A.M. is 0.25 parts per million (ppm). A 12-hour weather forecast predicts that the ozone level t hours later will be changing at...
-
Describe a patients rights during labor disputes.
-
You have been hired by a group of hotel owners, restaurant owners, and other people engaged in businesses that benefit from tourism on South Padre Island, Texas. They wish to learn how they can...
-
3. Economic Scenario Probability (Ps) Conditional Stock Returns Market Returns (%) (%) A B Recession 0.25 -13 -4 -2 Stagnation 0.40 16 -2 10 High Growth 0.20 32 21 22 Low Growth 0.15 12 18 16 Compute...
-
DM Yard Services has now added residential and commercial customers and is providing services on a regular basis. Review the Income Statement and Sales by Customer Summary Report: January 1 - May 31....
-
By loosening its credit standards, the CFO of the Henleigh Company believes she can increase the net present value of the firms daily cash flows by $10,000. If the increased daily NPV continues...
-
Calculate the 2011 total tax for Gordon Geist, a single taxpayer without dependents and no itemized deductions. He has an active income of $40,000, a shortterm capital gain income of $4,000 from the...
-
Summarize the five steps that make up the financial planning process.
-
List and explain the four common concerns that should guide all financial plans.
-
Interview three heads of household, each from a household representing a different stage of the life cycle orsocioeconomic status. Inquire about their financial planning process and their strategies...
-
Review the six financial accomplishments that may result from studying personal finance. In your opinion, which three are most important? Why?
-
What is the role of a Gantt Chart in operations management? A) Determining the project's budget B) Identifying the critical path C) Planning and scheduling project tasks D) Analyzing profitability
-
An Atomic Energy Commission nuclear facility was established in Hanford, Washington, in 1943. Over the years, a significant amount of strontium 90 and cesium 137 leaked into the Columbia River. In a...
-
Specify in words the alternative hypothesis being tested. Explain whether you decided to use a one-sided or a two- sided test and why.
-
Explain whether the width of a confidence interval would increase, decrease, or remain the same as a result of each of the following changes: a. The sample size is doubled, from 400 to 800. b. The...
-
Suppose a study first asked people whether they meditate regularly and then measured their blood pressures. The idea would be to see if those who meditate have lower blood pressure than those who do...
-
Eq. 7.36a is written for the conservation of momentum in y direction. Obtain Eq. 7.36-b wherein the stream function is independent variable. Eq. 7.36(a,b) y - v v +(1-y/R)v- + momentum: u u R-y + R P...
-
Show that the derivative of the boundary layer edge velocity is given by Eq. 7.64 for the figure given below. Eq. 7.64 M>>1 Ue dx R dy/dx = 1/R
-
Using Maslen method, find the approximate value of pressure and density at the junction of the sphere and the cone of Problem 7.29 at Mach number 8. Problem 7.29 An empirical way to determine shock...
Study smarter with the SolutionInn App