Skip to content

Instantly share code, notes, and snippets.

@notedit
Created February 12, 2012 09:11
Show Gist options
  • Save notedit/1807433 to your computer and use it in GitHub Desktop.
Save notedit/1807433 to your computer and use it in GitHub Desktop.
testServer.go
package main
import (
"fmt"
"recca/rpc"
)
type Args struct {
A,B int
}
type Reply struct {
C int
}
type Test struct{}
func (t *Test)Add(args Args,reply *Reply) error {
reply.C = args.A + args.B
return nil
}
func main() {
newServer := rpc.NewServer("localhost",1989)
newServer.Register(new(Test))
newServer.Serv()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment