[SOLVED] C++ C Scheme Java python socket compiler operating system software network 1.Project Description

$25

File Name: C++_C_Scheme_Java_python_socket_compiler_operating_system_software_network_1.Project_Description.zip
File Size: 904.32 KB

5/5 - (1 vote)

1.Project Description
In this project, you are required to implement a file downloader that can download a file from a server using TCP.

The executable file at the server-side and client-side for Windows, Linux, andMacOSare providedin the project demo file.

For your reference, we provide the source code at the server-side written in Cserver.cwhich can be compiled and run in Linux andMacOS. This is only for your reference. As a matter of fact, you do not need to know how the server-side program is implemented in this project.

You only need to implement the client program, namedDownloader. The file that your program needs to download from the file serveronly contains human-readable text. Your code must print out useful information, and the output must be formatted as follows:
IP Address:xxx.xxx.xxx.xxx Port Number:yyyyy
Connect status: a
Input the file name to be requested from the server: File Name
Send status: b
Open file status: c
Received text:zzz
Save text status: d
where the numberxxx.xxx.xxx.xxxandyyyyyare theIP AddressandPort Numberrespectively which are given as the input parameters. The stringsa,b,c, anddare printed to indicate the execution result, i.e. success or fail. The stringFile Nameis the name of the file in the server which is read from the input. The stringzzzrepresents the content of the file received from the file server. Once the client receives the content, it needs to save it in a file.

Note that the server program sends the text row by row continuously until the entire file content has been sent out. Therefore, a loop is needed in your program to receive the text as shown in the following code fragment.

while(length of received text > 0){
/* code for receiving text from the server */

/* code for saving text in the file */

}

Back to top

2.Development Environment
Hardware:
Two connected computers.
If you use two laptops:
if you are inCityU, you can connect the two laptops to the campus wireless network so that they can communicate with each other (How to do this?Links to an external site.).
if the campus wireless network is not available, you can set up a Wi-Fi ad-hoc network (How to do this?(Links to an external site.)).
If you use two desktops, you can directly connect the three computers using cables and configure them in a subnet (How to do this?(Links to an external site.)).

If you do not have two computers available for testing, you could install a virtual machine to test your program (How to do this?
Actions
).

Or you can simply SSH to gateway.cs.cityu.edu.hk server to implement and compile the client program, then run both server program and client program on that Linux server. The following link shows how to SSH to gateway.cs.cityu.edu.hk

https://cslab.cs.cityu.edu.hk/supports/unix-startup-guideLinks to an external site.
Software:
You can choose the coding language amongC/C++ (recommended), Java and Python based on your familiarity.
If you useWindows System:
for C/C++:
Visual Studio 2017:https://visualstudio.microsoft.com/downloads/(Links to an external site.)
Install C++ support in Visual Studio:https://docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation?view=vs-2017(Links to an external site.)
for Java:
IntelliJ IDEA:https://www.jetbrains.com/idea/download/#section=windows(Links to an external site.)
for Python:
PyCharm:https://www.jetbrains.com/pycharm/download/#section=windows(Links to an external site.)
If you useLinux Ubuntu SystemorMac OS X:
for C/C++:
Thegcc/g++ compiler is usually installed by default.
for Java:
IntelliJ IDEA: (Mac OS)https://www.jetbrains.com/idea/download/#section=mac(Links to an external site.)
IntelliJ IDEA: (Linux)https://www.jetbrains.com/idea/download/#section=linux(Links to an external site.)
for Python:
PyCharm: (Mac OS)https://www.jetbrains.com/pycharm/download/#section=mac(Links to an external site.)
PyCharm: (Linux)https://www.jetbrains.com/pycharm/download/#section=linux(Links to an external site.)
Remark: it is suggested that computers involved in the same working group should use thesame operating systemand apply thesame software toolfor the project design.
Back to top

3.Project Demo
Besides the program at the server-side, we have also provided the Demo Programs of the file Downloader to demonstrate the applications operations.

For Windows System, the demo program is provided as:WindowsDemo_2019.rar(Note that it is for the Windows 10 (64 bit) operating system)

For Linux System, the demo program is provided as:LinuxDemo2019.zip(Note that it is developed under Ubuntu 18 (64 bit) operating system)

For Mac OS, the demo program is provided as:NewMacDemo.zip(Note that it is developed under Mac OS High Sierra)

Some notes for the provided server program:
The default port number of the server is12345.
The server can accept up to 5 client connections simultaneously.
It prints out the related information if there is an error; otherwise, it continues silently until it has finished sending the file.
The server keeps listening even if the client disconnects from the server.
It prints outTransfer file successfully!once it has completed sending the file.

Back to top

4.Tasks List
Task 1: Socket initialization
Description: initialize and create the TCP socket.

Task 2: Initiate the connection request

Description:
Input the file server IP and port.
Initiate a connection on a socket.

Task 3: Send request to the file server
Description: send the name of the requested file to the file server.
Task 4: Receive content and save it to a file
Description: receive the file content from the file server and save it.

Task 5: Close socket
Description: close the connection socket by sending exit.

Here is theflowchartof this program. The input must include theIP AddressandPort Numberof the file server.

Find your IP address:
Linux or Mac: Typeifconfiginterminal
Windows: Network & Internet settings -> network properties

Back to top

5.ProjectRequirements and Tutorials

5.1. Project Tutorials
For the project implementation, we provide project tutorials forC/C++,JavaandPython. Basically, there are four tasks that your implementation needs to fulfill.

You can download the tutorials here:Tutorial for C C++
Actions
,Tutorial for Java
Actions
,Tutorialfor Python
Actions

Tutorials about file I/O can be found here:C tutorial(Links to an external site.)C++ tutorial(Links to an external site.)Java tutorial(Links to an external site.)Python tutorial(Links to an external site.)

6.Code Quality
We cannot completely specify the coding style that we would like to see but it includes the following:
Proper decomposition of a program into subroutines (and multiple source code files when necessary).
Commentjudiciously, but not profusely. Comments will help your TA understand your program.
Proper variable names.
Small number of global variables, if any. Most programs need a very small number of global variables.
The return values from all function calls should be checked and all values should be dealt with appropriately.

Back to top

7.AssessmentTool
You should provide instructions for the TA how to compile and run your code in yourreadmetext file. The development environment should also be indicated in this file.
TAs are not supposed to fix bugs.
If an executable file cannot be generated and run successfully, it will be considered as unsuccessful.
Any program that does not print the output as required in Section 1 will be considered unsuccessful.
If the program can be executed and the output is in the correct form, your program will be graded according to the following marking scheme inTable 1.

Table 1: Marking scheme.
Components
Weight
Initialize socket
10%
Connect to server
10%
Send request to server
10%
Receive file content from server
30%
Close connection
5%
Save text to a file
10%
Error handling
15%
Programming style and in-program comments
10%

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] C++ C Scheme Java python socket compiler operating system software network 1.Project Description
$25