ing
This commit is contained in:
parent
90fb76955e
commit
19cd72fdde
60
src/ts/@overflow/webapp/client/central/webapp/client.ts
Normal file
60
src/ts/@overflow/webapp/client/central/webapp/client.ts
Normal file
|
@ -0,0 +1,60 @@
|
|||
|
||||
export default class WebAppClient {
|
||||
private url: string;
|
||||
private conn: WebSocket;
|
||||
|
||||
private pendingRequests: Map<number, any>;
|
||||
|
||||
public constructor(url: string) {
|
||||
this.url = url;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* connect
|
||||
*/
|
||||
public connect(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
try {
|
||||
this.conn = new WebSocket(this.url);
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* close
|
||||
*/
|
||||
public close(): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
try {
|
||||
this.conn.close();
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* close
|
||||
*/
|
||||
public send(): void {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* close
|
||||
*/
|
||||
public call(method: string, ...params: any[]): void {
|
||||
|
||||
}
|
||||
/**
|
||||
* close
|
||||
*/
|
||||
public callTimeout(): void {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user