diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-14 07:25:33 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-14 07:25:33 +0800 |
commit | 28b14d3e6d43cb27019e21d0a93a80e7bee1de8c (patch) | |
tree | 9995026e87221a80cb5171364ffa734459c16b16 /rpc/comms/ipc_windows.go | |
parent | 73c4e6005c3e47342a4631955ca6fd2782925886 (diff) | |
parent | f9cbd16f27e393d4937354ee31435e0a2f689484 (diff) | |
download | go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.gz go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.bz2 go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.lz go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.xz go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.tar.zst go-tangerine-28b14d3e6d43cb27019e21d0a93a80e7bee1de8c.zip |
Merge pull request #1635 from bas-vk/useragent
support for user agents
Diffstat (limited to 'rpc/comms/ipc_windows.go')
-rw-r--r-- | rpc/comms/ipc_windows.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rpc/comms/ipc_windows.go b/rpc/comms/ipc_windows.go index ee49f069b..b2fe2b29d 100644 --- a/rpc/comms/ipc_windows.go +++ b/rpc/comms/ipc_windows.go @@ -667,7 +667,7 @@ func (self *ipcClient) reconnect() error { return err } -func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error { +func startIpc(cfg IpcConfig, codec codec.Codec, initializer func(conn net.Conn) (shared.EthereumApi, error)) error { os.Remove(cfg.Endpoint) // in case it still exists from a previous run l, err := Listen(cfg.Endpoint) @@ -687,6 +687,13 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error { id := newIpcConnId() glog.V(logger.Debug).Infof("New IPC connection with id %06d started\n", id) + api, err := initializer(conn) + if err != nil { + glog.V(logger.Error).Infof("Unable to initialize IPC connection - %v\n", err) + conn.Close() + continue + } + go handle(id, conn, api, codec) } |