Starting from:

$30

CS214- Assignment 3 Solved

More on Client-server programming (to be done individually)

Write a TCP client-server system to allow client programs to get the system date and time from the server. When a client connects to the server, the server gets the local time on the machine and sends it to the client. The client displays the date and time on the screen, and terminates. The server should be an iterative server.
                                    Submit two C/ Cpp files: <Your_Roll_Number>_time_server.c                    and

<Your_Roll_Number>_time_client.c
Write a simple UDP iterative server and client to convert a given DNS name (for example, www.google.com) into its IP address(es). The client will read the DNS name as a string from the user and send it to the server. The server will convert it to one or more IP addresses and return it back to the client. The client will then print ALL the addresses returned, and exit. For basic UDP socket communication, see the sample program given. To get the IP address corresponding to a DNS name, use the function gethostbyname(). Look up the description of the function from the man page and the tutorial on the webpage.
                 Submit            two            files:             <Your_Roll_Number>_dns_server.c             and

<Your_Roll_Number>_dns_client.c
Now suppose that the same server will act both as the time server in Problem 1 and the DNS server in Problem 2. Thus, some clients will request over the UDP socket for name-to-IP conversion, and some will connect over a TCP socket for the time. Thus, the server now needs to open both a TCP socket and a UDP socket, and accept request from any one (using the accept() + read()/send() call for TCP, and recvfrom() call for UDP), whichever comes first. Use the select() call to make the server wait for any one of the two connections, and handle whichever comes first. All handlings are iterative.
Submit one C file: <Your_Roll_Number>_combined_server.c
NOTE: Use the following port number:
50000 + last four digits of your roll number.

1.Please read the questions carefully and complete it.

Make a directory with name <Your_Roll_Number> and copy your all program (source code) and output file to that folder.
You can use C or Cpp for this assignment
Please copy your output and paste it to related program at the end of source code(pleasecomment it)/ if necessary you can take screen shot name it with its question number and put it in a same folder.
Test well before submission. Follow some coding style uniformly. Provide proper commentsin your code.
After completing all the tasks please show it to TA’s. Once the result is correct then only weallow you to upload to the moodle.

More products