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