Sun RPC was (at least I think) the most popular version of this. https://en.wikipedia.org/wiki/Sun_RPC
The generated code looked after all the marshalling/unmarshalling of your types, did the connection handshaking etc. You had to have a service running on your Unix machine (rpc.bind?). NFS used to use XDR and some variant of RPC to work but I am not sure it does any more.