Ask a question to Desklib · AI bot


Project On Implementing A Message Server | Server Program

3 Pages1047 Words301 Views

Added on  2019-09-22

BookmarkShareRelated Documents
In this project, we will 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 fornames, 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 — you do not have to do 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 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 andall 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 read 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 ( is the IPaddress). Use port 1050 as the port for listening. You will need to
Project On Implementing A Message Server | Server Program_1

Found this document preview useful?

Related Documents
Client Server Programming Using RSA

Faculty of Information & Communication Technology

COIT132229 Applied Distributed Systems Assignment