diff options
author | Determinant <[email protected]> | 2020-09-15 23:55:34 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-09-15 23:55:34 -0400 |
commit | 78745551c077bf54151202138c2629f288769561 (patch) | |
tree | 2b628e99fd110617089778fa91235ecd2888f4ef /rpc/doc.go | |
parent | 7d1388c743b4ec8f4a86bea95bfada785dee83f7 (diff) |
WIP: geth-tavum
Diffstat (limited to 'rpc/doc.go')
-rw-r--r-- | rpc/doc.go | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -29,8 +29,6 @@ Methods that satisfy the following criteria are made available for remote access - method must be exported - method returns 0, 1 (response or error) or 2 (response and error) values - - method argument(s) must be exported or builtin types - - method returned value(s) must be exported or builtin types An example method: @@ -73,14 +71,9 @@ An example server which uses the JSON codec: calculator := new(CalculatorService) server := NewServer() - server.RegisterName("calculator", calculator") - + server.RegisterName("calculator", calculator) l, _ := net.ListenUnix("unix", &net.UnixAddr{Net: "unix", Name: "/tmp/calculator.sock"}) - for { - c, _ := l.AcceptUnix() - codec := v2.NewJSONCodec(c) - go server.ServeCodec(codec, 0) - } + server.ServeListener(l) Subscriptions @@ -90,7 +83,6 @@ criteria: - method must be exported - first method argument type must be context.Context - - method argument(s) must be exported or builtin types - method must have return types (rpc.Subscription, error) An example method: |