From ae5685fd19b4cc1e27e17f983a846c576b7cd339 Mon Sep 17 00:00:00 2001 From: Brandon Nozaki Miller Date: Mon, 4 Jan 2016 01:33:55 -0800 Subject: [PATCH] added server.stop fixes #2 --- README.md | 8 ++++++++ lib/socketServer.js | 3 +++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index e398916..eddf091 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,14 @@ or specifying everything UDP | ipc.of | This is where socket connection refrences will be stored when connecting to them as a client via the `ipc.connectTo` or `iupc.connectToNet`. They will be stored based on the ID used to create them, eg : ipc.of.mySocket| | ipc.server| This is a refrence to the server created by `ipc.serve` or `ipc.serveNet`| +---- +### IPC Server Methods + +| method | definition | +|-----------|------------| +|start| start serving need top call ` serve ` or ` serveNet ` first to set up the server | +|stop| close the server and stop serving | + ---- ### IPC Events diff --git a/lib/socketServer.js b/lib/socketServer.js index 94130b0..a4c1163 100644 --- a/lib/socketServer.js +++ b/lib/socketServer.js @@ -78,6 +78,9 @@ function init(path,config,log,port){ socket ); }, + stop:function(){ + server.server.close(); + }, start : function(){ if(!this.path){ server.log('Socket Server Path not specified, refusing to start'.warn);