How to use the evt.port function in evt

To help you get started, we’ve selected a few evt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leanote / desktop-app / node_modules / server.js View on Github external
child_process.exec(sh1, function () {
					child_process.exec(sh2, callback);
				});
			}
			else {
				var sh = 'kill -9 $(lsof -i:' + Evt.port + ' -t)';
				child_process.exec(sh, callback);
			}
		}
		// killPort(function (error, stdout, stderr) {
	        // if (error !== null) {
		        // console.log('kill port error: ' + error);
	        // }

			server.listen(Evt.port);
			console.log("Server runing at port: " + Evt.port + ".");

			me.localUrl = Evt.localUrl;
			me._started = true;

			me.server = server;
	    // });
	},
github leanote / desktop-app / node_modules / server.js View on Github external
function killPort(callback) {
			if (Common.isWin()) {
				// & EXIT 表示只循环一次
				// Leanote会有两个pid绑定端口, 另一个和electron相关, kill掉也会把自己kill掉
				var sh1 = 'FOR /F "tokens=4 delims= " %P IN (\'netstat -a -n -o ^| findstr :' + Evt.port + '\') DO (TaskKill.exe /F /PID %P) & Exit';
				var sh2 = 'FOR /F "tokens=5 delims= " %P IN (\'netstat -a -n -o ^| findstr :' + Evt.port + '\') DO (TaskKill.exe /F /PID %P) & Exit';
				child_process.exec(sh1, function () {
					child_process.exec(sh2, callback);
				});
			}
			else {
				var sh = 'kill -9 $(lsof -i:' + Evt.port + ' -t)';
				child_process.exec(sh, callback);
			}
		}
		// killPort(function (error, stdout, stderr) {
github leanote / desktop-app / src / node_modules / server.js View on Github external
function killPort(callback) {
			if (Common.isWin()) {
				// & EXIT 表示只循环一次
				// Leanote会有两个pid绑定端口, 另一个和electron相关, kill掉也会把自己kill掉
				var sh1 = 'FOR /F "tokens=4 delims= " %P IN (\'netstat -a -n -o ^| findstr :' + Evt.port + '\') DO (TaskKill.exe /F /PID %P) & Exit';
				var sh2 = 'FOR /F "tokens=5 delims= " %P IN (\'netstat -a -n -o ^| findstr :' + Evt.port + '\') DO (TaskKill.exe /F /PID %P) & Exit';
				child_process.exec(sh1, function () {
					child_process.exec(sh2, callback);
				});
			}
			else {
				var sh = 'kill -9 $(lsof -i:' + Evt.port + ' -t)';
				child_process.exec(sh, callback);
			}
		}
		killPort(function (error, stdout, stderr) {