Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
rpc2
✓ github.com/cenkalti/rpc2
Create a bidirectional RPC server and client
package main
import (
"fmt"
"github.com/cenkalti/rpc2"
)
func main() {
server := rpc2.NewServer()
server.Handle("hello", func(client *rpc2.Client, args *string, reply *string) error {
*reply = "Hello, " + *args
return nil
})
go server.ListenAndServe("tcp", ":1234")
client, _ := rpc2.Dial("tcp", ":1234")
var reply string
client.Call("hello", "World", &reply)
fmt.Println(reply)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.0.5latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.