now handling responses

This commit is contained in:
2016-08-12 05:17:13 +02:00
parent da510eb87a
commit 3afede95fc
4 changed files with 60 additions and 34 deletions

View File

@@ -3,7 +3,7 @@ import * as helpers from "./smartsocket.helpers";
// import classes
import { SocketFunction } from "./smartsocket.classes.socketfunction";
import { SocketRequest, ISocketRequestDataObject } from "./smartsocket.classes.socketrequest";
import { SocketRequest, ISocketRequestDataObject, allSocketRequests } from "./smartsocket.classes.socketrequest";
import { SocketRole } from "./smartsocket.classes.socketrole";
// export interfaces
@@ -96,7 +96,8 @@ export class SocketConnection {
};
});
this.socket.on("functionResponse", (dataArg:ISocketRequestDataObject) => {
let targetSocketRequest = helpers.getSocketRequestById(dataArg.shortId);
targetSocketRequest.handleResponse(dataArg);
})
} else {
done.reject("socket needs to be authenticated first");