提交 13b1fa86 编写于 作者: yanghye's avatar yanghye

upgrade-dev v2.3.15

上级 b547e303
......@@ -47,9 +47,11 @@ func MemoryAddress() string {
return memoryAddress
}
func (m *ipcChannel) NewBrowseChannel(memoryAddresses ...string) *browserChannel {
// NewBrowserChannel 主进程
func (m *ipcChannel) NewBrowserChannel(memoryAddresses ...string) *browserChannel {
useNetIPCChannel = isUseNetIPC()
if useNetIPCChannel {
address := fmt.Sprintf("localhost:%d", IPC.Port())
address := fmt.Sprintf("localhost:%d", IPCChannel.Port())
listener, err := net.Listen("tcp", address)
if err != nil {
panic("Description Failed to create the IPC service Error: " + err.Error())
......
......@@ -29,8 +29,9 @@ type renderChannel struct {
}
func (m *ipcChannel) NewRenderChannel(channelId int64, memoryAddresses ...string) *renderChannel {
useNetIPCChannel = isUseNetIPC()
if useNetIPCChannel {
address := fmt.Sprintf("localhost:%d", IPC.Port())
address := fmt.Sprintf("localhost:%d", IPCChannel.Port())
conn, err := net.Dial("tcp", address)
if err != nil {
panic("Client failed to connect to IPC service Error: " + err.Error())
......
......@@ -39,7 +39,7 @@ var (
memoryAddress = "energy.sock"
useNetIPCChannel = false
ipcSock string
IPC = &ipcChannel{
IPCChannel = &ipcChannel{
browser: &browserChannel{
channel: sync.Map{},
mutex: sync.Mutex{},
......@@ -64,7 +64,6 @@ const (
)
func init() {
//useNetIPCChannel = isUseNetIPC()
ipcSock = filepath.Join(os.TempDir(), memoryAddress)
}
......@@ -100,7 +99,6 @@ func isUseNetIPC() bool {
}
ov := version.OSVersion
if (ov.Major > 10) || (ov.Major == 10 && ov.Build >= 17063) {
//不支持UnixSocket
return false
}
return true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册