ee-core 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,14 +27,6 @@ module.exports = appInfo => {
27
27
  */
28
28
  name: appInfo.name,
29
29
 
30
- /**
31
- * package.json
32
- * @member {Object} Config#pkg
33
- * @see {appInfo#pkg}
34
- * @since 1.0.0
35
- */
36
- pkg: appInfo.pkg,
37
-
38
30
  /**
39
31
  * The current directory of the application
40
32
  * @member {String} Config#baseDir
@@ -97,7 +89,31 @@ module.exports = appInfo => {
97
89
  * @default
98
90
  * @since 1.0.0
99
91
  */
100
- appUserDataDir: appInfo.appUserDataDir
92
+ appUserDataDir: appInfo.appUserDataDir,
93
+
94
+ /**
95
+ * system user home dir
96
+ * @member {String} Config#userHome
97
+ */
98
+ userHome: appInfo.userHome,
99
+
100
+ /**
101
+ * application version
102
+ * @member {String} Config#appVersion
103
+ */
104
+ appVersion: appInfo.appVersion,
105
+
106
+ /**
107
+ * application package status
108
+ * @member {boolean} Config#isPackaged
109
+ */
110
+ isPackaged: appInfo.isPackaged,
111
+
112
+ /**
113
+ * application exec file dir
114
+ * @member {String} Config#execDir
115
+ */
116
+ execDir: appInfo.execDir
101
117
  };
102
118
 
103
119
  /**
@@ -175,19 +191,11 @@ module.exports = appInfo => {
175
191
  },
176
192
  };
177
193
 
178
- /* egg服务 (待定) */
179
- config.egg = {
180
- enable: false, // 是否启用
181
- title: 'ee', // 进程的title属性标识(默认你的应用名称-英文)
182
- port: 7068,
183
- hostname: '127.0.0.1',
184
- workers: 1 // 工作进程数据
185
- };
186
-
187
- /* web渲染服务 */
188
- config.webServer = {
189
- port: 7068
190
- };
194
+ /* 内置socket服务 */
195
+ config.socketServer = {
196
+ port: 7070, // 默认端口
197
+ isDynamic: false // 如果值为false,框架默认使用port端口(如果默认端口被使用,则随机获取一个);如果为true,默认端口无效,框架随机生成
198
+ };
191
199
 
192
200
  return config;
193
201
  };
package/core/lib/ee.js CHANGED
@@ -88,15 +88,11 @@ class EeCore extends KoaApplication {
88
88
  */
89
89
  const Loader = this[EE_LOADER];
90
90
  assert(Loader, 'Symbol.for(\'ee#loader\') is required');
91
- this.loader = new Loader({
92
- baseDir: options.baseDir,
93
- homeDir: options.homeDir,
91
+ let loaderOptions = Object.assign({
94
92
  logger: this.console,
95
- app: this,
96
- env: options.env,
97
- appUserData: options.appUserData,
98
- isPackaged: options.isPackaged
99
- });
93
+ app:this
94
+ }, options);
95
+ this.loader = new Loader(loaderOptions);
100
96
  }
101
97
 
102
98
  /**
@@ -147,11 +147,7 @@ class EeLoader {
147
147
  */
148
148
  getAppInfo() {
149
149
  const env = this.serverEnv;
150
- const scope = this.serverScope;
151
- const home = this.getHomedir();
152
- const baseDir = this.options.baseDir;
153
- const appUserDataDir = this.options.appUserData;
154
-
150
+
155
151
  /**
156
152
  * Meta information of the application
157
153
  * @class AppInfo
@@ -167,7 +163,7 @@ class EeLoader {
167
163
  * The current directory, where the application code is.
168
164
  * @member {String} AppInfo#baseDir
169
165
  */
170
- baseDir,
166
+ baseDir: this.options.baseDir,
171
167
 
172
168
  /**
173
169
  * The environment of the application, **it's not NODE_ENV**
@@ -186,24 +182,18 @@ class EeLoader {
186
182
  * @member {String} AppInfo#env
187
183
  * @see https://Eejs.org/zh-cn/basics/env.html
188
184
  */
189
- env,
185
+ env: env,
190
186
 
191
187
  /**
192
188
  * @member {String} AppInfo#scope
193
189
  */
194
- scope,
190
+ scope: this.serverScope,
195
191
 
196
192
  /**
197
193
  * The use directory, same as `process.env.HOME`
198
194
  * @member {String} AppInfo#HOME
199
195
  */
200
- home: home,
201
-
202
- /**
203
- * parsed from `package.json`
204
- * @member {Object} AppInfo#pkg
205
- */
206
- pkg: this.pkg,
196
+ home: this.getHomedir(),
207
197
 
208
198
  /**
209
199
  * The directory whether is baseDir or HOME depend on env.
@@ -213,9 +203,37 @@ class EeLoader {
213
203
  * keep root directory in baseDir when local and unittest
214
204
  * @member {String} AppInfo#root
215
205
  */
216
- root: env === 'local' || env === 'unittest' ? home : appUserDataDir,
206
+ root: env === 'local' || env === 'unittest' ? this.getHomedir() : this.options.appUserData,
217
207
 
218
- appUserDataDir: appUserDataDir
208
+ /**
209
+ * electron application data dir
210
+ * @member {String} AppInfo#appUserDataDir
211
+ */
212
+ appUserDataDir: this.options.appUserData,
213
+
214
+ /**
215
+ * system user home dir
216
+ * @member {String} AppInfo#userHome
217
+ */
218
+ userHome: this.options.userHome,
219
+
220
+ /**
221
+ * application version
222
+ * @member {String} AppInfo#appVersion
223
+ */
224
+ appVersion: this.options.appVersion,
225
+
226
+ /**
227
+ * application package status
228
+ * @member {boolean} AppInfo#isPackaged
229
+ */
230
+ isPackaged: this.options.isPackaged,
231
+
232
+ /**
233
+ * application exec file dir
234
+ * @member {String} AppInfo#execDir
235
+ */
236
+ execDir: this.options.execDir
219
237
  };
220
238
  }
221
239
 
@@ -409,15 +427,9 @@ class EeLoader {
409
427
  }
410
428
 
411
429
  getPkg() {
412
- //let filePath = '';
413
- // let variablePath = 'build'; // 打包前路径
414
- // if (this.options.isPackaged) {
415
- // variablePath = '..'; // 打包后路径
416
- // }
417
- // filePath = path.join(app.getAppPath(), variablePath, "package.json");
418
-
419
- const content = utility.readJSONSync(path.join(this.options.homeDir, 'package.json'));
420
- return content;
430
+ const filePath = path.join(this.options.homeDir, 'package.json');
431
+ const json = utility.readJSONSync(filePath);
432
+ return json;
421
433
  }
422
434
  }
423
435
 
@@ -11,8 +11,6 @@ class Appliaction extends EeApp {
11
11
  const { env } = process;
12
12
 
13
13
  // 路径不能使用绝对,打包前后有问题
14
-
15
-
16
14
  let options = {
17
15
  env: 'prod',
18
16
  serverScope: '',
@@ -24,9 +22,10 @@ class Appliaction extends EeApp {
24
22
  userHome: app.getPath('home'),
25
23
  appData: app.getPath('appData'),
26
24
  appUserData: app.getPath('userData'),
27
- logsDir: app.getPath('logs'),
25
+ //logsDir: app.getPath('logs'),
28
26
  appVersion: app.getVersion(),
29
- isPackaged: app.isPackaged
27
+ isPackaged: app.isPackaged,
28
+ execDir: app.getAppPath()
30
29
  }
31
30
 
32
31
  // argv
@@ -37,8 +36,12 @@ class Appliaction extends EeApp {
37
36
  }
38
37
  }
39
38
 
40
- // normalize env
39
+ // exec directory (exe dmg dep) for prod
40
+ if (options.env == 'prod' && app.isPackaged) {
41
+ options.execDir = path.dirname(app.getPath('exe'));
42
+ }
41
43
 
44
+ // normalize env
42
45
  env.NODE_ENV = 'production';
43
46
  env.EE_HOME = options.homeDir;
44
47
  env.EE_SERVER_ENV = options.env;
@@ -47,7 +50,7 @@ class Appliaction extends EeApp {
47
50
  env.EE_APP_DATA = options.appData;
48
51
  env.EE_APP_USER_DATA = options.appUserData;
49
52
  env.EE_WEB_PORT = null;
50
- env.EE_IPC_PORT = null;
53
+ env.EE_SOCKET_PORT = null;
51
54
  env.EGG_SERVER_ENV = options.env;
52
55
  debug('options:%j', options)
53
56
 
package/lib/baseApp.js CHANGED
@@ -111,38 +111,26 @@ class BaseApp extends EeAppCore {
111
111
  /**
112
112
  * 调用 egg api
113
113
  */
114
- async curlEgg (method, uri, params, timeout = 15000) {
115
- let result = null;
116
- try {
117
- const port = this.config.egg.port;
118
- const url = "http://127.0.0.1:" + port + uri;
119
- // console.log('[ee:baseApp] [curlEgg] url:', url);
120
- const response = await this.curl(url, {
121
- method: method,
122
- contentType: 'application/json',
123
- data: params,
124
- dataType: 'json',
125
- timeout: timeout,
126
- });
127
- result = response.data;
128
- } catch (err) {
129
- this.logger.error('[ee:baseApp] [curlEgg] throw error:', err);
130
- }
131
-
132
- return result;
133
- }
134
-
135
- /**
136
- * @class socket模块
137
- * @since 1.0.0
138
- */
139
- get socket () {
140
- const obj = {
141
- ipc: {},
142
- server: {}
143
- }
144
- return obj;
145
- }
114
+ // async curlEgg (method, uri, params, timeout = 15000) {
115
+ // let result = null;
116
+ // try {
117
+ // const port = this.config.egg.port;
118
+ // const url = "http://127.0.0.1:" + port + uri;
119
+ // // console.log('[ee:baseApp] [curlEgg] url:', url);
120
+ // const response = await this.curl(url, {
121
+ // method: method,
122
+ // contentType: 'application/json',
123
+ // data: params,
124
+ // dataType: 'json',
125
+ // timeout: timeout,
126
+ // });
127
+ // result = response.data;
128
+ // } catch (err) {
129
+ // this.logger.error('[ee:baseApp] [curlEgg] throw error:', err);
130
+ // }
131
+
132
+ // return result;
133
+ // }
146
134
 
147
135
  /**
148
136
  * core app have been loaded
package/lib/constant.js CHANGED
@@ -23,8 +23,7 @@ module.exports = {
23
23
  },
24
24
  socketIo: {
25
25
  channel: {
26
- eggIoEe: 'c1',
27
- eggIoFrotend: 'c2'
26
+ partySoftware: 'c1',
28
27
  }
29
28
  }
30
29
  };
package/lib/eeApp.js CHANGED
@@ -20,16 +20,17 @@ class EeApp extends BaseApp {
20
20
  * 生成端口
21
21
  */
22
22
  async createPorts () {
23
- const ipcPort = await getPort();
24
- const webPort = this.config.env === 'prod' ? await getPort() : this.config.webServer.port;
25
- this.config.webServer.port = webPort;
26
- process.env.EE_IPC_PORT = ipcPort;
23
+ const socketPort = await getPort({port: this.config.socketServer.port});
24
+ //const webPort = this.config.env === 'prod' ? await getPort() : this.config.webServer.port;
25
+ const webPort = await getPort();
26
+
27
+ process.env.EE_SOCKET_PORT = socketPort;
27
28
  process.env.EE_WEB_PORT = webPort;
28
- this.coreLogger.info('[ee-core:EeApp] [createPorts] ipc port:', ipcPort);
29
+ this.coreLogger.info('[ee-core:EeApp] [createPorts] socket port:', socketPort);
29
30
  this.coreLogger.info('[ee-core:EeApp] [createPorts] web port:', webPort);
30
31
 
31
32
  // 更新db配置
32
- this.getCoreDB().setItem('ipc_port', ipcPort);
33
+ this.config.socketServer.port = socketPort;
33
34
  this.getCoreDB().setItem('config', this.config);
34
35
  }
35
36
 
@@ -86,15 +87,13 @@ class EeApp extends BaseApp {
86
87
  Menu.setApplicationMenu(null);
87
88
  }
88
89
 
89
- this.loadRemoreWeb();
90
-
91
90
  this.loadingView(winOptions);
92
91
 
93
92
  await this.windowReady();
94
93
 
95
94
  await this.loderPreload();
96
95
 
97
- this.loadLocalWeb();
96
+ this.selectAppType();
98
97
 
99
98
  // DevTools
100
99
  if (!app.isPackaged && this.config.openDevTools) {
@@ -102,38 +101,6 @@ class EeApp extends BaseApp {
102
101
  }
103
102
  }
104
103
 
105
- /**
106
- * 加载远程网址
107
- */
108
- loadRemoreWeb () {
109
- const remoteConfig = this.config.remoteUrl;
110
- if (remoteConfig.enable) {
111
- this.loadMainUrl('remote_web', remoteConfig.url);
112
- }
113
- }
114
-
115
- /**
116
- * 加载本地前端资源
117
- */
118
- loadLocalWeb () {
119
- // 如果加载了远程,则不能加载本地的
120
- const remoteConfig = this.config.remoteUrl;
121
- if (remoteConfig.enable) {
122
- return;
123
- }
124
-
125
- const self = this;
126
- const staticDir = path.join(this.config.homeDir, 'public', 'dist');
127
-
128
- const koaApp = new Koa();
129
- koaApp.use(koaServe(staticDir))
130
- const port = process.env.EE_WEB_PORT;
131
- koaApp.listen(port, () => {
132
- const url = 'http://127.0.0.1:' + port;
133
- self.loadMainUrl('local_web', url);
134
- });
135
- }
136
-
137
104
  /**
138
105
  * 加载已经实现的功能
139
106
  */
@@ -174,11 +141,6 @@ class EeApp extends BaseApp {
174
141
  * 加载loading页面
175
142
  */
176
143
  loadingView (winOptions) {
177
- const remoteConfig = this.config.remoteUrl;
178
- if (remoteConfig.enable) {
179
- return;
180
- }
181
-
182
144
  if (!this.config.loadingPage) {
183
145
  return;
184
146
  }
@@ -204,25 +166,74 @@ class EeApp extends BaseApp {
204
166
  }
205
167
 
206
168
  /**
207
- * 加载主页面
169
+ * 应用类型 (远程、html、单页应用)
208
170
  */
209
- loadMainUrl (type, url) {
171
+ selectAppType () {
172
+ let type = '';
173
+ let url = '';
210
174
 
211
- // 环境模式 (远程模式,不加载dev)
175
+ // 远程模式
212
176
  const remoteConfig = this.config.remoteUrl;
213
- if (this.config.env !== 'prod' && remoteConfig.enable == false) {
214
- const protocol = 'http://';
215
- const developmentModeConfig = this.config.developmentMode;
216
- const selectMode = developmentModeConfig.default;
217
- const modeInfo = developmentModeConfig.mode[selectMode];
218
- url = protocol + modeInfo.hostname + ':' + modeInfo.port;
219
-
220
- this.coreLogger.info('[ee-core:EeApp] frontend server :', url)
177
+ if (remoteConfig.enable == true) {
178
+ type = 'remote_web';
179
+ url = remoteConfig.url;
180
+ this.loadMainUrl(type, url);
181
+ return;
221
182
  }
222
183
 
184
+ const protocol = 'http://';
185
+ const developmentModeConfig = this.config.developmentMode;
186
+ const selectMode = developmentModeConfig.default;
187
+ const modeInfo = developmentModeConfig.mode[selectMode];
188
+ let staticDir = null;
189
+
190
+ // html模式
191
+ if (selectMode == 'html') {
192
+ if (this.config.env !== 'prod') {
193
+ staticDir = path.join(this.config.homeDir, 'frontend', 'dist');
194
+ }
195
+ this.loadLocalWeb('html', staticDir, modeInfo);
196
+ return;
197
+ }
198
+
199
+ // 单页应用
200
+ url = protocol + modeInfo.hostname + ':' + modeInfo.port;
201
+ if (this.config.env !== 'prod') {
202
+ this.loadMainUrl('spa', url);
203
+ } else {
204
+ this.loadLocalWeb('spa');
205
+ }
206
+ }
207
+
208
+ /**
209
+ * 加载本地前端资源
210
+ */
211
+ loadLocalWeb (mode, staticDir, hostInfo) {
212
+ const self = this;
213
+ if (!staticDir) {
214
+ staticDir = path.join(this.config.homeDir, 'public', 'dist')
215
+ }
216
+
217
+ const koaApp = new Koa();
218
+ koaApp.use(koaServe(staticDir))
219
+ const port = process.env.EE_WEB_PORT;
220
+ let url = 'http://127.0.0.1:' + port;
221
+ if (mode == 'html') {
222
+ url += '/' + hostInfo.indexPage;
223
+ }
224
+
225
+ koaApp.listen(port, () => {
226
+ self.loadMainUrl(mode, url);
227
+ });
228
+ }
229
+
230
+ /**
231
+ * 主页面
232
+ */
233
+ loadMainUrl (type, url) {
223
234
  this.logger.info('main page is env: %s, type: %s, url: %s', this.config.env, type, url);
224
235
  this.electron.mainWindow.loadURL(url);
225
- }
236
+ }
226
237
 
227
238
  /**
228
239
  * egg
@@ -269,7 +280,17 @@ class EeApp extends BaseApp {
269
280
  */
270
281
  async appQuit () {
271
282
  await this.beforeClose();
283
+
284
+ // 窗口销毁
272
285
  this.electron.mainWindow.destroy();
286
+
287
+ //console.log('Exit now!');
288
+ // 托盘销毁
289
+ // if (this.electron.tray) {
290
+ // console.log('ssssssssssss');
291
+ // this.electron.tray.destroy();
292
+ // }
293
+
273
294
  app.quit();
274
295
  }
275
296
 
@@ -308,6 +329,12 @@ class EeApp extends BaseApp {
308
329
  process.on('uncaughtException', function(err) {
309
330
  self.logger.error(err);
310
331
  });
332
+
333
+ // process.on('SIGINT', function () {
334
+ // console.log('Exit now!');
335
+ // self.appQuit();
336
+ // process.exit();
337
+ // });
311
338
  }
312
339
 
313
340
  /**
@@ -8,7 +8,7 @@ const EggConsoleLogger = require('egg-logger').EggConsoleLogger;
8
8
  class SocketClient {
9
9
  constructor (port) {
10
10
  this.consoleLogger = new EggConsoleLogger();
11
- port = port ? port : this.getIpcPort();
11
+ port = port ? parseInt(port) : this.getSocketcPort();
12
12
 
13
13
  assert(typeof port === 'number', 'port required, and must be a number');
14
14
  this.consoleLogger.info('[ee-core:socket:client] start client');
@@ -29,7 +29,7 @@ class SocketClient {
29
29
  call (method = '', ...params) {
30
30
  return new Promise((resolve, reject) => {
31
31
  // 获取通信频道
32
- const channel = constant.socketIo.channel.eggIoEe;
32
+ const channel = constant.socketIo.channel.partySoftware;
33
33
  this.client.emit(channel, { cmd: method, params: params }, (response) => {
34
34
  resolve(response);
35
35
  });
@@ -41,10 +41,10 @@ class SocketClient {
41
41
  return coreDB;
42
42
  }
43
43
 
44
- getIpcPort () {
44
+ getSocketcPort () {
45
45
  const cdb = this.getCoreDB();
46
- const port = cdb.getItem('ipc_port');
47
- return port;
46
+ const port = cdb.getItem('config').socketServer.port;
47
+ return parseInt(port);
48
48
  }
49
49
  }
50
50
 
@@ -11,7 +11,7 @@ const is = require('is-type-of');
11
11
  */
12
12
  class SocketServer {
13
13
  constructor (app) {
14
- let port = process.env.EE_IPC_PORT ? parseInt(process.env.EE_IPC_PORT) : parseInt(this.getIpcPort());
14
+ let port = process.env.EE_SOCKET_PORT ? parseInt(process.env.EE_SOCKET_PORT) : parseInt(this.getSocketcPort());
15
15
 
16
16
  assert(typeof port === 'number', 'port required, and must be a number');
17
17
 
@@ -23,11 +23,12 @@ class SocketServer {
23
23
  }
24
24
 
25
25
  connec () {
26
+ const self = this;
26
27
  this.consoleLogger.info('[ee-core:socket:server] connection .....');
27
28
  this.io.on('connection', (socket) => {
28
- const channel = constant.socketIo.channel.eggIoEe;
29
+ const channel = constant.socketIo.channel.partySoftware;
29
30
  socket.on(channel, async (message, callback) => {
30
- this.consoleLogger.info('[ee-core:socket:server] socket id:' + socket.id + ' message cmd: ' + message.cmd);
31
+ self.consoleLogger.info('[ee-core:socket:server] socket id:' + socket.id + ' message cmd: ' + message.cmd);
31
32
 
32
33
  try {
33
34
  // 找函数
@@ -36,7 +37,7 @@ class SocketServer {
36
37
  let fn = null;
37
38
  if (is.string(cmd)) {
38
39
  const actions = cmd.split('.');
39
- let obj = this.app;
40
+ let obj = self.app;
40
41
  actions.forEach(key => {
41
42
  obj = obj[key];
42
43
  if (!obj) throw new Error(`class or function '${key}' not exists`);
@@ -45,12 +46,11 @@ class SocketServer {
45
46
  }
46
47
  if (!fn) throw new Error('function not exists');
47
48
 
48
- const result = await fn.call(this.app, args);
49
+ const result = await fn.call(self.app, args);
49
50
  callback(result);
50
51
  } catch (err) {
51
- this.app.logger.error('[ee:socket] throw error:', err);
52
+ self.app.logger.error('[ee:socket] throw error:', err);
52
53
  }
53
-
54
54
  });
55
55
  });
56
56
  }
@@ -60,9 +60,9 @@ class SocketServer {
60
60
  return coreDB;
61
61
  }
62
62
 
63
- getIpcPort () {
63
+ getSocketcPort () {
64
64
  const cdb = this.getCoreDB();
65
- const port = cdb.getItem('ipc_port');
65
+ const port = cdb.getItem('config').socketServer.port;
66
66
  return port;
67
67
  }
68
68
  }
@@ -11,7 +11,7 @@ const ipcServer = require('./ipcServer');
11
11
  // 启动 socket server
12
12
  new socketServer(app);
13
13
 
14
- // 启动 ipc server
14
+ // 启动 electron ipc server
15
15
  new ipcServer(app);
16
16
 
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -47,6 +47,11 @@ const fsPro = require('fs-extra');
47
47
 
48
48
  // 复制到ee资源目录
49
49
  const eeResourceDir = path.join(homeDir, 'public', 'dist');
50
+
51
+ // 清空历史资源
52
+ fs.rmdirSync(eeResourceDir, {recursive: true});
53
+ console.log('[ee-core] [replace_dist] 清空历史资源:', eeResourceDir);
54
+
50
55
  fsPro.copySync(sourceDir, eeResourceDir);
51
56
  console.log('[ee-core] [replace_dist] 复制资源到:', eeResourceDir);
52
57
 
package/utils/index.js CHANGED
@@ -6,6 +6,7 @@ const constant = require('../lib/constant');
6
6
  const convert = require('koa-convert');
7
7
  const is = require('is-type-of');
8
8
  const co = require('co');
9
+ const utility = require('utility');
9
10
 
10
11
  exports.mkdir = function(dirpath, dirname) {
11
12
  // 判断是否是第一次调用
@@ -52,8 +53,7 @@ exports.chmodPath = function(path, mode) {
52
53
  exports.getPackage = function() {
53
54
  const cdb = this.getCoreDB();
54
55
  const config = cdb.getItem('config');
55
- const filePath = path.join(config.homeDir, 'package.json');
56
- const json = require(filePath);
56
+ const json = utility.readJSONSync(path.join(config.homeDir, 'package.json'));
57
57
 
58
58
  return json;
59
59
  };
@@ -118,16 +118,16 @@ exports.getLogDir = function() {
118
118
  /**
119
119
  * 获取 socketio port
120
120
  */
121
- exports.getIpcPort = function() {
121
+ exports.getSocketPort = function() {
122
122
  const cdb = this.getCoreDB();
123
- const port = cdb.getItem('ipc_port');
124
- return port;
123
+ const port = cdb.getItem('config').socketServer.port;
124
+ return parseInt(port);
125
125
  }
126
126
 
127
127
  /**
128
- * 获取 ipc channel
128
+ * 获取 socket channel
129
129
  */
130
- exports.getIpcChannel = function() {
130
+ exports.getSocketChannel = function() {
131
131
  return constant.socketIo.channel;
132
132
  }
133
133