reconnect is now working

This commit is contained in:
2016-08-14 22:17:55 +02:00
parent 7b2b2bd151
commit bd8697ac6e
10 changed files with 139 additions and 64 deletions

View File

@ -2,5 +2,7 @@ import * as plugins from "./smartsocket.plugins";
export * from "./smartsocket.classes.smartsocket";
export * from "./smartsocket.classes.smartsocketclient";
export * from "./smartsocket.classes.socketfunction";
export * from "./smartsocket.classes.socketrole";
// need something more exposed? Create an issue on GitLab!
// need something more exposed? Create an issue on GitLab!

View File

@ -57,6 +57,7 @@ export class Smartsocket {
// communication
clientCall(){
// TODO: target specific client and initiate response
}
}

View File

@ -46,7 +46,7 @@ export class SmartsocketClient {
alias:this.alias,
authenticated:false,
role:undefined,
socket: plugins.socketIoClient(socketUrl,{})
socket: plugins.socketIoClient(socketUrl,{multiplex:false})
});
this.socketConnection.socket.on("requestAuth", () => {
console.log("server requested authentication");
@ -65,6 +65,7 @@ export class SmartsocketClient {
disconnect(){
let done = plugins.q.defer();
this.socketConnection.socket.disconnect();
this.socketConnection = undefined;
plugins.beautylog.ok("disconnected!");
done.resolve();
return done.promise;