diff options
author | Bas van Kervel <bas@ethdev.com> | 2016-03-14 16:38:54 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2016-04-12 17:02:39 +0800 |
commit | aa9fff3e68b1def0a9a22009c233150bf9ba481f (patch) | |
tree | 926c241574d6d80dfe4ffd6d2e447a9f7f84dc8b /rpc/doc.go | |
parent | 7e02105672cda92889a78db864a5701d78f45eb2 (diff) | |
download | dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.gz dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.bz2 dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.lz dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.xz dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.zst dexon-aa9fff3e68b1def0a9a22009c233150bf9ba481f.zip |
rpc: various fixes/enhancements
rpc: be less restrictive on the request id
rpc: improved documentation
console: upgrade web3.js to version 0.16.0
rpc: cache http connections
rpc: rename wsDomains parameter to wsOrigins
Diffstat (limited to 'rpc/doc.go')
-rw-r--r-- | rpc/doc.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rpc/doc.go b/rpc/doc.go index c9dba3270..77202634f 100644 --- a/rpc/doc.go +++ b/rpc/doc.go @@ -29,11 +29,23 @@ Methods that satisfy the following criteria are made available for remote access - method returned value(s) must be exported or builtin types An example method: - func (s *CalcService) Div(a, b int) (int, error) + func (s *CalcService) Add(a, b int) (int, error) When the returned error isn't nil the returned integer is ignored and the error is send back to the client. Otherwise the returned integer is send back to the client. +Optional arguments are supported by accepting pointer values as arguments. E.g. +if we want to do the addition in an optional finite field we can accept a mod +argument as pointer value. + + func (s *CalService) Add(a, b int, mod *int) (int, error) + +This RPC method can be called with 2 integers and a null value as third argument. +In that case the mod argument will be nil. Or it can be called with 3 integers, +in that case mod will be pointing to the given third argument. Since the optional +argument is the last argument the RPC package will also accept 2 integers as +arguments. It will pass the mod argument as nil to the RPC method. + The server offers the ServeCodec method which accepts a ServerCodec instance. It will read requests from the codec, process the request and sends the response back to the client using the codec. The server can execute requests concurrently. Responses |