Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (24 sloc) 498 Bytes
// Go RPC client connecting to a Unix socket.
//
// Eli Bendersky [http://eli.thegreenplace.net]
// This code is in the public domain.
package main
import (
"fmt"
"log"
"net/rpc"
)
func main() {
client, err := rpc.DialHTTP("unix", "/tmp/rpc.sock")
if err != nil {
log.Fatal("dialing:", err)
}
// Synchronous call
name := "Joe"
var reply string
err = client.Call("Greeter.Greet", &name, &reply)
if err != nil {
log.Fatal("greeter error:", err)
}
fmt.Printf("Got '%s'\n", reply)
}
You can’t perform that action at this time.