aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/ipc.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/ipc.go')
-rw-r--r--rpc/ipc.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/rpc/ipc.go b/rpc/ipc.go
index 8de18a56f..b05e503d7 100644
--- a/rpc/ipc.go
+++ b/rpc/ipc.go
@@ -18,26 +18,23 @@ package rpc
import (
"context"
- "fmt"
"net"
"github.com/ethereum/go-ethereum/log"
+ "github.com/ethereum/go-ethereum/p2p/netutil"
)
-// CreateIPCListener creates an listener, on Unix platforms this is a unix socket, on
-// Windows this is a named pipe
-func CreateIPCListener(endpoint string) (net.Listener, error) {
- return ipcListen(endpoint)
-}
-
// ServeListener accepts connections on l, serving JSON-RPC on them.
func (srv *Server) ServeListener(l net.Listener) error {
for {
conn, err := l.Accept()
- if err != nil {
+ if netutil.IsTemporaryError(err) {
+ log.Warn("RPC accept error", "err", err)
+ continue
+ } else if err != nil {
return err
}
- log.Trace(fmt.Sprint("accepted conn", conn.RemoteAddr()))
+ log.Trace("Accepted connection", "addr", conn.RemoteAddr())
go srv.ServeCodec(NewJSONCodec(conn), OptionMethodInvocation|OptionSubscriptions)
}
}