Project On Implementing A Message Server | Server Program

Added on - Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 1 of 3 pages
In this project, we will implement a “message server” in a distributedenvironment (i.e. between processes running on machines that arephysically separate) by using BSD sockets.In this assignment, we will provide a writer program (i.e. you will be given awriter program), and you are required to create a server program, which willcommunicate with writers by sockets. 3 identical writer programs (except fornames, writer 1, writer 2, and writer 3, respectively) will run on one or moremachines and the server on another machine ( Specifications:1.Each writer program will connect and send a message (i.e. message”writer1” will be sent to the server from writer 1 — you do not have todo this) 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 ofcommunication (Step 4) with the writer, and the parent process loopsback to listen for a connection — this makes the parent ready foranother connection.4.A message from the writer must be stored by the appropriate threadprocesses in shared memory. This memory is shared by the server andall its threads, and can store only one message. The message lengthwill be no more than 15 characters (14 chars plus 1 char stringterminator in C), such as ”writer1” ”writer2” and ”writer3”.5.A writer process should be invoked (started) with the writer name. Forinstance, suppose writer program name is ”writerp”, the first writershould be started by typing ”writerp” and will read the message fromthe file infile.6.The shared memory must be properly protected as a critical section sothat the stored message will never be corrupted even during thehandling of concurrent connections from multiple writers.7.After a message from a writer is successfully stored in the sharedmemory by one of the server threads, after a 2 second sleep, theactual contents of the shared memory should be sent back to theoriginal writer by the same server thread.8.Set the server up to run on ( is the IPaddress). Use port 1050 as the port for listening. You will need to
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access