start transitioning to better SocketFunction handling

This commit is contained in:
Philipp Kunz 2018-03-18 17:50:37 +01:00
parent b2bd66a6a6
commit 483cb38175
3 changed files with 6 additions and 2 deletions

View File

@ -21,6 +21,7 @@ export declare class Smartsocket {
startServer(): Promise<{}>; startServer(): Promise<{}>;
/** /**
* starts the server with another server * starts the server with another server
* also works with an express style server
*/ */
setServer(httpServerArg: http.Server): Promise<void>; setServer(httpServerArg: http.Server): Promise<void>;
/** /**

View File

@ -41,6 +41,7 @@ class Smartsocket {
} }
/** /**
* starts the server with another server * starts the server with another server
* also works with an express style server
*/ */
setServer(httpServerArg) { setServer(httpServerArg) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
@ -115,4 +116,4 @@ class Smartsocket {
} }
} }
exports.Smartsocket = Smartsocket; exports.Smartsocket = Smartsocket;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzb2NrZXQuY2xhc3Nlcy5zbWFydHNvY2tldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c29ja2V0LmNsYXNzZXMuc21hcnRzb2NrZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLGlEQUFpRDtBQUdqRCw2QkFBNkI7QUFFN0IsVUFBVTtBQUNWLDZCQUFnQztBQUVoQyxpR0FBMEU7QUFDMUUsMkZBQW9FO0FBVXBFO0lBTUUsWUFBWSxVQUEwQztRQUZ0RCxnQkFBVyxHQUFHLElBQUksZUFBUyxFQUFvQixDQUFDO1FBQ2hELGdCQUFXLEdBQUcsSUFBSSxlQUFTLEVBQWMsQ0FBQztRQUV4QyxJQUFJLENBQUMsT0FBTyxHQUFHLFVBQVUsQ0FBQztJQUM1QixDQUFDO0lBRUQ7O09BRUc7SUFDRyxXQUFXOztZQUNmLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNL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0FBQyxHQUFHLEVBQUU7WUFDVCxNQUFNLENBQUMsZ0JBQWdCLENBQUMsd0JBQXdCLEVBQUUsQ0FBQztRQUNyRCxDQUFDLENBQUM7YUFDRCxLQUFLLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDWCxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ25CLENBQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQztDQUNGO0FBeEdELGtDQXdHQyJ9

View File

@ -75,9 +75,11 @@ tap.test('client should disconnect and reconnect', async () => {
}); });
await done.promise; await done.promise;
}); });
tap.test('2 clients should connect in parallel', async () => { tap.test('2 clients should connect in parallel', async () => {
// nothing here // TODO: implement parallel test
}); });
tap.test('should be able to make a functionCall from client to server', async () => { tap.test('should be able to make a functionCall from client to server', async () => {
let done = smartq.defer(); let done = smartq.defer();
testSmartsocketClient testSmartsocketClient