rpc: add new client, use it everywhere

The new client implementation supports concurrent requests,
subscriptions and replaces the various ad hoc RPC clients
throughout go-ethereum.
This commit is contained in:
Felix Lange
2016-07-12 17:47:15 +02:00
parent bb01bea4e2
commit 91b7690428
30 changed files with 2007 additions and 756 deletions

View File

@ -22,6 +22,8 @@ import (
"net"
"os"
"path/filepath"
"golang.org/x/net/context"
)
// ipcListen will create a Unix socket on the given endpoint.
@ -40,6 +42,6 @@ func ipcListen(endpoint string) (net.Listener, error) {
}
// newIPCConnection will connect to a Unix socket on the given endpoint.
func newIPCConnection(endpoint string) (net.Conn, error) {
return net.DialUnix("unix", nil, &net.UnixAddr{Name: endpoint, Net: "unix"})
func newIPCConnection(ctx context.Context, endpoint string) (net.Conn, error) {
return dialContext(ctx, "unix", endpoint)
}