aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/comms/ipc_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/comms/ipc_unix.go')
-rw-r--r--rpc/comms/ipc_unix.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/rpc/comms/ipc_unix.go b/rpc/comms/ipc_unix.go
index 131fb86f2..b5eec92db 100644
--- a/rpc/comms/ipc_unix.go
+++ b/rpc/comms/ipc_unix.go
@@ -18,7 +18,17 @@ func newIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error) {
return nil, err
}
- return &ipcClient{codec.New(c)}, nil
+ return &ipcClient{cfg.Endpoint, codec, codec.New(c)}, nil
+}
+
+func (self *ipcClient) reconnect() error {
+ self.coder.Close()
+ c, err := net.DialUnix("unix", nil, &net.UnixAddr{self.endpoint, "unix"})
+ if err == nil {
+ self.coder = self.codec.New(c)
+ }
+
+ return err
}
func startIpc(cfg IpcConfig, codec codec.Codec, api api.EthereumApi) error {