diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-04 18:51:16 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-08-04 18:51:16 +0800 |
commit | b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1 (patch) | |
tree | 00ab530e6f28230400a65ebae7a4610f94cc1f80 /rpc/comms/ipc_unix.go | |
parent | ff66e8fa2935d59d5104e324861d9e1bb517ffaa (diff) | |
parent | 5c949d3b3ba81ea0563575b19a7b148aeac4bf61 (diff) | |
download | go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar.gz go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar.bz2 go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar.lz go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar.xz go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.tar.zst go-tangerine-b01f2c29ae48dba0ba4a90a4c6dbbadfc313f5b1.zip |
Merge pull request #1574 from fjl/fdtrack
fdtrack: hack to track file descriptor usage
Diffstat (limited to 'rpc/comms/ipc_unix.go')
-rw-r--r-- | rpc/comms/ipc_unix.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/comms/ipc_unix.go b/rpc/comms/ipc_unix.go index aff90cfaa..432bf93b5 100644 --- a/rpc/comms/ipc_unix.go +++ b/rpc/comms/ipc_unix.go @@ -22,6 +22,7 @@ import ( "net" "os" + "github.com/ethereum/go-ethereum/fdtrack" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/rpc/codec" @@ -50,15 +51,16 @@ func (self *ipcClient) reconnect() error { func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error { os.Remove(cfg.Endpoint) // in case it still exists from a previous run - l, err := net.ListenUnix("unix", &net.UnixAddr{Name: cfg.Endpoint, Net: "unix"}) + l, err := net.Listen("unix", cfg.Endpoint) if err != nil { return err } + l = fdtrack.WrapListener("ipc", l) os.Chmod(cfg.Endpoint, 0600) go func() { for { - conn, err := l.AcceptUnix() + conn, err := l.Accept() if err != nil { glog.V(logger.Error).Infof("Error accepting ipc connection - %v\n", err) continue |