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 program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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