graceful shutdown

- confirmation dialog
- shutdown node service
This commit is contained in:
cv
2021-06-04 12:30:36 +02:00
parent ae4363f6f6
commit c5db68fa26
4 changed files with 88 additions and 15 deletions
+7 -1
View File
@@ -1,7 +1,13 @@
import { Server } from 'node-osc';
let oscServer = null;
export const shutdownOSCServer = () => {
if (oscServer != null) oscServer.close();
};
export const initiateOSC = (config) => {
const oscServer = new Server(config.port, '0.0.0.0', () => {
oscServer = new Server(config.port, '0.0.0.0', () => {
console.log(`OSC Server is listening on port ${config.port}`);
});