Carefully read sections 4.1 to 4.3 and Chapter 5, especially section 5.3 on Remote Procedure calls. Go has an excellent implementation of RPCs. Create a Chat server using the Go RPC Package which...


Carefully read sections 4.1 to 4.3 and Chapter 5, especially section 5.3 on Remote Procedure calls. Go has an excellent implementation of RPCs. Create a Chat server using the Go RPC Package which implements the purpose of the remote procedure call, which is to run a program that calls a function on another host (server) to run the code for the function and return the results of the function execution to the original caller host which uses the results to complete a program. RPCs follow the client-server model, but the purpose is to have a server run a function in a separate process on its host. It reduces the load on the original caller machine, which, may in fact, be a powerful computational cluster doing a large data computational problem with a method such as MapReduce. The program will familiarize you with Go’s RPC interface. Note that Go RPC is a typical message-passing protocol for a distributed system where there is continuous traffic between the sender process and the receiver process. Go RPC is designed for situations where the client and the server are both using Go language, but, in general, it is not required that both sides of the application are in the same language. For example, one could have a client in C that calls a server using Java.






A remote procedure call (RPC) is a means by whicha program can call a procedure on another machine, and receive the result, as if it were executed on the original machine. This is a very powerful abstraction, which abstracts away much of the typical difficulty of message passing that occurs in client-server applications. RPC may be classified as “middleware” running on top of sockets between the transport and application layers of the network. With RPC the programmer uses syntax and semantics that are very similar to the ones used to call a subroutine by a main function in a single process program.






See Figure 5.10 on page 200 of the DSCD textbook for a diagram of the software objects that are developed in the creation of an RPC program. The RPC program uses a request-reply protocol (see Figure 5.2), where the contents of the request and reply messages are shown in Figure 5.4. The RPC can be written to implement either at-least-once or at-most-once semantics (see section 5.3.1). This means the design choices include the possible retransmission of requests because of duplicates and retransmission of results (see Figure 5.9). You should also study section 5.3.3 and be able to use an
interface definition language such as the one for the case study of Sun RPC.


Requirements of Chat Server Go program:



  1. The program must be written in Go.

  2. The server should be able to read short messages from clients concurrently (at the same time) and enable other participants to respond quickly. The communication should be similar to that of a spoken conversation, unlike apps such as those for forums and email.

  3. Let multiple people talk at the same time on the Chat server.

  4. Anything said is seen by everyone unless the sender specifies that the message is a PM (private message) and names the receiver.

  5. Make the chat app extensible. To add more features we should be able to implement and export a server-side method and write a client stub which calls the exported method over RPC.

  6. Test your program to see that the Request and Reply, and the PM work. Use the Go Testing program for doing this.

  7. User Requests should include a Request to join the Chat Room, get and display unseen messages including PM.

  8. Use the Go RPC package for implementing remote procedure calls in Go including the implementation of a client-server interface with the server by the client. Study the net/rpc package in Go.

  9. Register the program with an HTTP handler in the RPC package and turn the terminal program into a Web Service that handles HTTP requests through a TCP Listener. See HandleHTTP and DialHTTP in Go RPC package.


  10. 10.Submit the Go source code, a ReadME file with the compile and run options that you use , and submit a file containing the sequence of input strings that you use as client messages to the Chat server. Zip the files submitted into one .zip file using 7-zip.

Sep 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here