aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorunknown <basvankervel@gmail.com>2015-06-25 19:53:41 +0800
committerunknown <basvankervel@gmail.com>2015-06-25 19:53:41 +0800
commit04910c902a7654706cc0f97b86627661fcd22b36 (patch)
tree8ad8d70cdbc5b0966f5aa2f475caf6b0d8519216
parentffbe5656ff2cba43c813f46f743fde4d1ab2dd58 (diff)
downloaddexon-04910c902a7654706cc0f97b86627661fcd22b36.tar.gz
dexon-04910c902a7654706cc0f97b86627661fcd22b36.tar.zst
dexon-04910c902a7654706cc0f97b86627661fcd22b36.zip
support for large request/response on windows
-rw-r--r--rpc/comms/ipc_windows.go39
1 files changed, 8 insertions, 31 deletions
diff --git a/rpc/comms/ipc_windows.go b/rpc/comms/ipc_windows.go
index 44c82ef8a..4914a99c4 100644
--- a/rpc/comms/ipc_windows.go
+++ b/rpc/comms/ipc_windows.go
@@ -640,7 +640,7 @@ func newIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error) {
return nil, err
}
- return &ipcClient{cfg.Endpoint, codec, codec.New(c)}, nil
+ return &ipcClient{cfg.Endpoint, c, codec, codec.New(c)}, nil
}
func (self *ipcClient) reconnect() error {
@@ -667,36 +667,13 @@ func startIpc(cfg IpcConfig, codec codec.Codec, api shared.EthereumApi) error {
glog.V(logger.Error).Infof("Error accepting ipc connection - %v\n", err)
continue
}
-
- go func(conn net.Conn) {
- codec := codec.New(conn)
-
- for {
- req, err := codec.ReadRequest()
- if err == io.EOF {
- codec.Close()
- return
- } else if err != nil {
- glog.V(logger.Error).Infof("IPC recv err - %v\n", err)
- codec.Close()
- return
- }
-
- var rpcResponse interface{}
- res, err := api.Execute(req)
-
- rpcResponse = shared.NewRpcResponse(req.Id, req.Jsonrpc, res, err)
- err = codec.WriteResponse(rpcResponse)
- if err != nil {
- glog.V(logger.Error).Infof("IPC send err - %v\n", err)
- codec.Close()
- return
- }
- }
- }(conn)
- }
- }()
-
+
+ go handle(conn, api, codec)
+ }
+
+ os.Remove(cfg.Endpoint)
+ }()
+
glog.V(logger.Info).Infof("IPC service started (%s)\n", cfg.Endpoint)
return nil