aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/comms/comms.go
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@gmail.com>2015-06-25 21:54:16 +0800
committerBas van Kervel <basvankervel@gmail.com>2015-06-25 21:54:16 +0800
commit662285074e55a3915f7236a04fec355c3f416eb8 (patch)
tree87f24d50fa75351444a5992cb319cf565695b2a5 /rpc/comms/comms.go
parent5757a0edb59f854433d11982b2ba4831cceb167e (diff)
downloadgo-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar.gz
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar.bz2
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar.lz
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar.xz
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.tar.zst
go-tangerine-662285074e55a3915f7236a04fec355c3f416eb8.zip
improved logging for IPC connection lifetime management
Diffstat (limited to 'rpc/comms/comms.go')
-rw-r--r--rpc/comms/comms.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/rpc/comms/comms.go b/rpc/comms/comms.go
index 1374bde3f..6e980149f 100644
--- a/rpc/comms/comms.go
+++ b/rpc/comms/comms.go
@@ -43,7 +43,7 @@ type EthereumClient interface {
SupportedModules() (map[string]string, error)
}
-func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
+func handle(id int, conn net.Conn, api shared.EthereumApi, c codec.Codec) {
codec := c.New(conn)
for {
@@ -52,8 +52,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
codec.Close()
return
} else if err != nil {
- glog.V(logger.Error).Infof("comms recv err - %v\n", err)
codec.Close()
+ glog.V(logger.Debug).Infof("Closed IPC Conn %06d recv err - %v\n", id, err)
return
}
@@ -71,8 +71,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
err = codec.WriteResponse(responses[:responseCount])
if err != nil {
- glog.V(logger.Error).Infof("comms send err - %v\n", err)
codec.Close()
+ glog.V(logger.Debug).Infof("Closed IPC Conn %06d send err - %v\n", id, err)
return
}
} else {
@@ -82,8 +82,8 @@ func handle(conn net.Conn, api shared.EthereumApi, c codec.Codec) {
rpcResponse = shared.NewRpcResponse(requests[0].Id, requests[0].Jsonrpc, res, err)
err = codec.WriteResponse(rpcResponse)
if err != nil {
- glog.V(logger.Error).Infof("comms send err - %v\n", err)
codec.Close()
+ glog.V(logger.Debug).Infof("Closed IPC Conn %06d send err - %v\n", id, err)
return
}
}