ing
This commit is contained in:
parent
62617e5990
commit
9d43ba870b
|
@ -7,6 +7,8 @@ import {
|
|||
export type OnDisconnectFunc = () => void;
|
||||
export type OnResponseFunc = (response: any) => void;
|
||||
|
||||
const PROTOCOL_NAME = '1.0';
|
||||
|
||||
type ID_TYPE = number;
|
||||
|
||||
interface RequestQueue {
|
||||
|
@ -55,6 +57,7 @@ export default class WebSocketRPC {
|
|||
return new Promise<any>((resolve, reject) => {
|
||||
const requestID = this.getRequestID();
|
||||
let request = new Request<ID_TYPE>(requestID, method, args);
|
||||
request.Protocol = PROTOCOL_NAME;
|
||||
|
||||
this.conn.send(JSON.stringify(request));
|
||||
this.requestQueue.set(requestID, {resolve: resolve, reject: reject});
|
||||
|
|
Loading…
Reference in New Issue
Block a user