Created
February 12, 2012 09:11
-
-
Save notedit/1807433 to your computer and use it in GitHub Desktop.
testServer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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