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...
-
Suppose a Corse store in Kansas City, Missouri, ended May 2012 with 700,000 units of merchandise that cost an average of $6 each. Suppose the store then sold 650,000 units for $8,450,000 during June....
-
Pop Corporation paid $1,800,000 for 90,000 shares of Son Company's 100,000 outstanding shares on January 1, 2016, when Son's equity consisted of $1,000,000 of $10 par common stock and $500,000...
-
The following information is available for Jay Company: Calculate the following ratios for 2019: a. Gross profit percentage b. Return on sales c. Asset turnover d. Return on assets e. Return on...
-
Seventeen years ago, the Archer Corporation borrowed $6,500,000. Since then, cumulative inflation has been 65 percent (a compound rate of approximately 3 percent per year). a. When the firm repays...
-
A project's internal rate of return (IRR) is the -Select- on a bond. The equation for calculating the IRR is: that forces the PV of its inflows to equal its cost. The IRR is an estimate of the...
-
Jon Fulkerson has also received a credit application from Seether, LLC, a private company. An abbreviated portion of the financial information provided by the company is shown below: Total assets...
-
Augusta National Golf Club (ANGC) is the most well known, exclusive private clubs in the world. In this assignment, I would like you to discuss why you think ANGC is considered one of the top clubs...
-
DeSoto Tools Incorporated is planning to expand production. The expansion will cost $2,600,000, which can be financed either by bonds at an interest rate of 7 percent or by selling 52,000 shares of...
-
2. Here is the polynomial function: k(x) = x 8x + 10x + 2x +4 a) Use the remainder and factor theorems, to determine whether or not the binomial x-2 is a factor of c(x). Show your work. b) If it is,...
-
In the diagram below the displacement-time-graph of a spring oscillator is given. 20+ 10+ t/s 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.5 1.8 2 -10+ y/cm -20- For a mass of 6.7kg find the maximum potential...
-
Abel is 43 years old, and he owns his car, which he uses to get to work. His collision deductible is $250, and he does not have comprehensive coverage. If his car's safety rating is 22, how much does...
-
Presented below is information related to Skysong Company. Cost Retail Beginning inventory $150,815 $283,000 Purchases 1,369,000 2,130,000 Markups 93,200 Markup cancellations 14,700 Markdowns 35,900...
-
On October 1, 2024, Sandhill Co. declared an annual cash dividend to preferred shareholders of $3 per share; at the time the dividend was declared, there were 3,100 preferred shares issued and...
-
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...
-
The accounting profession has been investigated by Congress over a number of years. However, none of the investigations or recommendations for change seems to have made a difference in that fraud...
-
The following two questions directly relate to ethics standards in the AICPA Code of Professional Conduct: a. Is it ever improper for a CPA/CPA firm to accept a commission from a client for...
-
Have you ever agreed to do something when you werent sure that you had the skills to accomplish the job? Why did you agree to do it? Can you draw an analogy between your motivations and the ethical...
Study smarter with the SolutionInn App