...

/

Remote Procedure Calls with RPC

Remote Procedure Calls with RPC

This lesson covers how Go lets two different machines (a server machine and a client machine) communicate with another using remote calls.

We'll cover the following...

Go programs can communicate with each other through the net/rpc-package; so this is another application of the client-server paradigm. It provides a convenient means of making function calls over a network connection. Of course, this is only useful when the programs run on different machines. The rpc package builds on the package gob to turn its encode/decode automation into transport for method calls across the network.

A server registers an object, making it visible as a service with the type-name of the object. This provides access to the exported methods of that object across a network or other I/O connection for remote clients. It is all about exposing methods on types over a network. The package uses the Http and TCP protocol, and ...