From e3eee0c32f0a78fc97e98b575a7f17707668379b Mon Sep 17 00:00:00 2001 From: yaofeng Date: Wed, 30 May 2018 10:38:41 +0800 Subject: [PATCH] 1 --- ElectronNET.CLI/ElectronNET.CLI.csproj | 2 +- ElectronNET.Host/api/ipc.js | 1 - ElectronNET.Host/main.js | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ElectronNET.CLI/ElectronNET.CLI.csproj b/ElectronNET.CLI/ElectronNET.CLI.csproj index be7bfef..4b963b1 100644 --- a/ElectronNET.CLI/ElectronNET.CLI.csproj +++ b/ElectronNET.CLI/ElectronNET.CLI.csproj @@ -9,7 +9,7 @@ true ..\artifacts ElectronNET.CLI - 1.0.1 + 1.0.2 Gregor Biswanger, Robert Muehsig Electron.NET diff --git a/ElectronNET.Host/api/ipc.js b/ElectronNET.Host/api/ipc.js index ecb2817..9654982 100644 --- a/ElectronNET.Host/api/ipc.js +++ b/ElectronNET.Host/api/ipc.js @@ -5,7 +5,6 @@ module.exports = function (socket) { socket.on('registerIpcMainChannel', function (channel) { // 监听主程序注册 electron_1.ipcMain.removeAllListeners(channel); // yf add 防止重复监听 electron_1.ipcMain.on(channel, function (event, args) { // 监听前端的推送 - console.log('ipc emit...', 'global.elesocket', global.elesocket.id, channel); global.elesocket.emit(channel, [event.preventDefault(), args]); // 发送到后端 }); }); diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index a51d3ce..09f4888 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -15,12 +15,14 @@ app.on('ready', () => { function startSocketApiBridge(port) { io = require('socket.io')(port); + // yf add - io.setMaxListeners(0); startAspCoreBackend(port); io.on('connection', (socket) => { + global.elesocket = socket; + global.elesocket.setMaxListeners(0); console.log('ASP.NET Core Application connected...', 'global.elesocket', global.elesocket.id, new Date()); appApi = require('./api/app')(socket, app);