mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-22 06:54:44 +00:00
1
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageOutputPath>..\artifacts</PackageOutputPath>
|
||||
<PackageId>ElectronNET.CLI</PackageId>
|
||||
<Version>1.0.1</Version>
|
||||
<Version>1.0.2</Version>
|
||||
<Authors>Gregor Biswanger, Robert Muehsig</Authors>
|
||||
<Product>Electron.NET</Product>
|
||||
<Company />
|
||||
|
||||
@@ -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]); // 发送到后端
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user