Implement a message server in a distributed environment

Assignment Help C/C++ Programming
Reference no: EM131457881

Implement a "message server" in a distributed environment (i.e. between processes running on machines that are physically separate) by using BSD sockets.

In this assignment, we will provide a writer program (i.e. you will be given a writer program), and you are required to create a server program, which will communicate with writers by sockets. 3 identical writer programs (except for names, writer 1, writer 2, and writer 3, respectively) will run on one or more machines and the server on another machine.

Assignment Specifications:

1. Each writer program will connect and send a message (i.e. message "writer1" will be sent to the server from writer 1) to the server.

2. The server process will accept this socket connection from a writer, and create a thread process after the socket is accepted.

3. After a thread is created it is responsible for taking care of communication (Step 4) with the writer, and the parent process loops back to listen for a connection - this makes the parent ready for another connection.

4. A message from the writer must be stored by the appropriate thread processes in shared memory. This memory is shared by the server and all its threads, and can store only one message. The message length will be no more than 15 characters (14 chars plus 1 char string terminator in C), such as "writer1" "writer2" and "writer3".

5. A writer process should be invoked (started) with the writer name. For instance, suppose writer program name is "writerp", the first writer should be started by typing " writerp" and will real the message from the file infile.

6. The shared memory must be properly protected as a critical section so that the stored message will never be corrupted even during the handling of concurrent connections from multiple writers.

7. After a message from a writer is successfully stored in the shared memory by one of the server threads, after a 2 second sleep, the actual contents of the shared memory should be sent back to the original writer by the same server thread.

8. Set the server up to run on netcluster.cse.usf.edu (131.247.3.8 is the IP address). Use port 1050 as the port for listening. You will need to examine the socket, connect, bind, listen, accept, send and rccv man pages for the appropriate system calls. (some of them, such as send, gotten via man send). Your server should loop for a total of n connection accepts, where n will be 3 in our trials.

Look at setsockopt to free the socket after use.

Attachment:- Assignment Files.rar

Reference no: EM131457881

Questions Cloud

What is the international fisher effect : Discuss whether good corporate governance is necessary for MNEs - Explain the theory of comparative advantage and What is the International Fisher Effect?
Disadvantages of freely exchange rate systems : Discuss the advantages and disadvantages of freely exchange rate systems.
What will the price of this bond : what will the price of this bond be in 25 years?
What is the expected rate of return on the stock : What is the expected rate of return on the stock? Should the investor acquire the stock?
Implement a message server in a distributed environment : Implement a "message server" in a distributed environment (i.e. between processes running on machines that are physically separate) by using BSD sockets
What is the expected rate of return on shares : XYZ Inc. has an 11.5% equity return and retains 55% of its earnings for re-investment purposes. What is the expected rate of return on XYZ shares?
Review the love of god in islam and christianity : Review the document's claims about the "love of God" in Islam and Christianity. Write down substantive ways that the two traditions are in agreement.
Broussard skateboards sales are expected to increase : Use the AFN equation to forecast Broussard's additional funds needed for the coming year.
Compute intrinsic values for each options : Compute intrinsic values for each of these options and identify whether they are in-the-money, at-the-money, or out-of-the-money.

Reviews

len1457881

4/11/2017 1:04:00 AM

Topic: C programming. Detailed Question: One thing please, the work must be original (free plagiarism). Also, please add comments to the code. In this assignment, we will provide a writer program (i.e. you will be given a writer program), and you are required to create a server program, which will communicate with writers by sockets.

Write a Review

C/C++ Programming Questions & Answers

  Create valle products accdb database file

Create a new table named Orders using the table design below. You may create your table in design view or datasheet view. Save the Orders table as Orders Your Name. Define a one-to-many relationship between the Customer table and Orders table. Ri..

  Create a program that verifies the strength of a password

Create a .cpp program that verifies the strength of a password that a user is entering is strong (complex/secure) enough. In the main area of the program, prompt the user to enter a password.

  Suggest an application system which is able to perform some

suggest an application system which is able to perform some arithmetic computations like commission system encryption

  Prepare the program to calculate the future investment value

Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the subsequent formula:

  Where can grep be found for windows for linux

What is grep? Where can grep be found for Windows? For Linux?

  Write a function to print first n number of fibonacci series

Write a recursive function to print first n number of Fibonacci series.

  About recursion that makes it useful tool

What is it about recursion that makes it a useful tool when working with trees?

  Write a program that reads the scores from the file

Write a program that reads the scores from the file and displays their total and average. Scores are separated by blanks.

  Create a program which will determine a users age in months

Create a program which will determine a user's age in months, given their age in years. Include meaningful comments in your code. Be sure the user understands I/O via meaningful messages.

  Function that returns the maximum value of the array

Arrays are collections of elements of the same type. The elements of the array can be accessed using their position (index) in the array.

  Implement a program to add three numbers

implement a program to add three numbers - I can get the two numbers but not 3.  Need to be able use in PEP 8 loader and executor.  All I need is the object

  Write a c program who implement four level priority process

This project is to write a C program who implement four level priority process dispatcher operating within the constraints of finite available memory and I/O resources.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd