support for large request/response on windows

This commit is contained in:
unknown 2015-06-25 04:53:41 -07:00
parent ffbe5656ff
commit 04910c902a

View File

@ -640,7 +640,7 @@ func newIpcClient(cfg IpcConfig, codec codec.Codec) (*ipcClient, error) {
return nil, err 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 { 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) glog.V(logger.Error).Infof("Error accepting ipc connection - %v\n", err)
continue continue
} }
go func(conn net.Conn) { go handle(conn, api, codec)
codec := codec.New(conn) }
for { os.Remove(cfg.Endpoint)
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)
}
}()
glog.V(logger.Info).Infof("IPC service started (%s)\n", cfg.Endpoint) glog.V(logger.Info).Infof("IPC service started (%s)\n", cfg.Endpoint)
return nil return nil