Creates a process pool of n processes

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

P1. Consider that a TCP server is designed in the following manner:

– Server creates a process pool of N processes. Each process can create a pool of T threads. Each thread accepts a connection on a shared listening descriptor.

– Whenever a process completes processing CPP number of clients across all its threads, server terminates that process and adds a new process to the pool. This is to avoid accumulation of memory leaks in the process.

– Thread processes client's request as per the chat protocol described here: Client can send three messages JOIN <name>, LEAV and CHAT <targetname> <msg>. In JOIN message, client sends its nickname and in CHAT message it sends the nickname of the person to whom it needs to be delivered and the contents. When server receives a CHAT message, it sends the message on the socket matching the nickname.

Server accepts port no, N, T and CPP as command line parameters. For the above requirements, write a program to implement the server.

You can use any language to implement it. Program should print meaningful output for every event.

Deliverables:
– well documented source code with README on how to run it
– screen recording of the demo with explanation
– pdf file explaining design decisions

Verified Expert

The solution file is implemented in net beans and report generated in ms word which has the source code of the server, client, and cthread.The program is implemented TCP server creates a process pool of N processes. Each process can create a pool of T threads. Each thread accepts a connection on a shared listening descriptor. Whenever a process completes processing CPP number of clients across all its threads, the server terminates that process and adds a new process to the pool. The client can send three messages to JOIN, LEAV and CHAT. In JOIN message, the client sends its nickname and in CHAT message it sends the nickname of the person to whom it needs to be delivered and the contents. When the server receives a CHAT message, it sends the message on the socket matching the nickname. The report has source code, class diagram use case diagram and the screenshot of program output.

Reference no: EM132255746

Questions Cloud

Determine the cash balance per Oriole Limited books : The reconciled cash balance from June's bank reconciliation is $18,340. Determine the cash balance per Oriole Limited's books
What are the credit spreads on the short term bonds : What are the credit spreads on the short term and longer term bonds? Do they seem compatible with the ratings of the bonds?
Which facts lead you to believe that you will need fewer : Which facts lead you to believe that you will need fewer drivers next year? What other information would you want to make a more accurate forecast?
Discuss how a newer entrepreneurial venture might differ : Discuss how a newer entrepreneurial venture might differ from a more mature, intrapreneurial venture in its approach to social media.
Creates a process pool of n processes : Create a process pool of N processes. Each process can create a pool of T threads. Each thread accepts a connection on a shared listening descriptor
How could mcdonalds be a real threat : Why McDonald's is not a real threat? How could McDonald's be a real threat?
What would net income and return on assets be for the year : Division B is able to make only $28,800 on sales of $329,000. Based on the profit margins (returns on sales), which division is superior?
Differentiate short term from long term problems : Identify criteria against which you evaluate alternative solutions (i.e. time for implementation, tangible costs, acceptability to management)
Discuss the culture of the united arab emirates : Discuss the culture of the United Arab Emirates , and India using Hofstede's cultural dimensions.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Build a table of reynolds numbers at flow velocities

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Create and prepare a disk file for records containing struct

Store the account records in the file using the same hashing/rehashing technique used for storing them in an array of structures.

  Implement a matrix class for two-by-two matrices

Implement a Matrix class for 2-by-2 matrices. Include a default constructor, a copy constructor, an inverse() function that returns the inverse of the matrix.

  Write down a c program to generate a matrix

The program should take the matrix dimensions (number of rows and number of columns) from the user.

  Develop a program that when you pipe in a file

develop a program that when you pipe in a file it will demonstrate on the left had side the line number  work by having a program piped in and when a \n occurs a new line and number is indicated.

  Prepare a c program that has this description

n is an integer, >= 0. x points to the first element of an int array with n position. p points to the first element of another int array array, also with n position.

  Write programme that allows a user to enter distinct words

Write a programme that allows a user to enter three distinct words and returns them as a single string

  Prompts the user to enter time in 12-hour notation

Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must  contain  three  exception  classes

  When is it better to allocate an object statically on stack

CPSC 131- In general, when is it better to allocate an object statically on the stack (as opposed to dynamically on the heap)? Give an example of a programming scenario where an object should certainly be stack-allocated.

  Write a program that prompts the user to input

One metric ton is approximately 2205 pounds. Write a program that prompts the user to input the amount of rice, in pounds, in a bag. The program outputs the number of bags needed to store one.

  Advantages and disadvantages of using iso standards

Discussion Questions from the book "A Guide to Computer Forensics and Investigations" 3rd Edition

  Multiplying the current balance

The interest is calculated by multiplying the current balance, rate and time period which is one quarter of a year as in this case. A new balance is calculated by adding that interest.

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