aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/server_test.go
Commit message (Collapse)AuthorAgeFilesLines
* rpc: implement full bi-directional communication (#18471)Felix Lange2019-02-041-109/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | New APIs added: client.RegisterName(namespace, service) // makes service available to server client.Notify(ctx, method, args...) // sends a notification ClientFromContext(ctx) // to get a client in handler method This is essentially a rewrite of the server-side code. JSON-RPC processing code is now the same on both server and client side. Many minor issues were fixed in the process and there is a new test suite for JSON-RPC spec compliance (and non-compliance in some cases). List of behavior changes: - Method handlers are now called with a per-request context instead of a per-connection context. The context is canceled right after the method returns. - Subscription error channels are always closed when the connection ends. There is no need to also wait on the Notifier's Closed channel to detect whether the subscription has ended. - Client now omits "params" instead of sending "params": null when there are no arguments to a call. The previous behavior was not compliant with the spec. The server still accepts "params": null. - Floating point numbers are allowed as "id". The spec doesn't allow them, but we handle request "id" as json.RawMessage and guarantee that the same number will be sent back. - Logging is improved significantly. There is now a message at DEBUG level for each RPC call served.
* all: import "context" instead of "golang.org/x/net/context"Felix Lange2017-03-231-2/+1
| | | | | | | | | | There is no need to depend on the old context package now that the minimum Go version is 1.7. The move to "context" eliminates our weird vendoring setup. Some vendored code still uses golang.org/x/net/context and it is now vendored in the normal way. This change triggered new vet checks around context.WithTimeout which didn't fire with golang.org/x/net/context.
* rpc: refactor subscriptions and filtersBas van Kervel2016-08-171-1/+1
|
* rpc: add new client, use it everywhereFelix Lange2016-07-231-3/+11
| | | | | | The new client implementation supports concurrent requests, subscriptions and replaces the various ad hoc RPC clients throughout go-ethereum.
* rpc: various fixes/enhancementsBas van Kervel2016-04-121-159/+39
| | | | | | | | 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
* rpc: add pub/sub supportBas van Kervel2016-04-021-6/+10
|
* rpc: migrated the RPC insterface to a new reflection based RPC layerBas van Kervel2016-01-261-0/+271