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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user