diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-06-19 00:23:13 +0800 |
---|---|---|
committer | Bas van Kervel <bas@ethdev.com> | 2015-06-22 15:17:09 +0800 |
commit | f20256377731097c9478ede750efffd46d83b494 (patch) | |
tree | 25ea2b0de5382ed25dde5ff2021214625f3e9865 /rpc/comms/ipc_unix.go | |
parent | 36a6b16a3bec15131318ebed1c8c2f9204a5a328 (diff) | |
download | go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar.gz go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar.bz2 go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar.lz go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar.xz go-tangerine-f20256377731097c9478ede750efffd46d83b494.tar.zst go-tangerine-f20256377731097c9478ede750efffd46d83b494.zip |
added attach over ipc command
Diffstat (limited to 'rpc/comms/ipc_unix.go')
-rw-r--r-- | rpc/comms/ipc_unix.go | 12 |
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 { |