Golang net/rpc.Dial(),DialHTTP() and DialHTTPPath() functions example

package net/rpc

Golang net/rpc.Dial(),DialHTTP() and DialHTTPPath() functions usage example

 client, err = rpc.DialHTTPPath("tcp", "example.com:8080", "/pathtoprocedure")

or

 client, err := rpc.DialHTTP("tcp", "example.com:8080") // HTTP RPC server

or

 client, err := rpc.Dial("tcp", "example.com:8080")

 if err != nil {
 panic(err)
 }

References :

http://golang.org/pkg/net/rpc/#Dial

http://golang.org/pkg/net/rpc/#DialHTTP

Advertisement