|
@@ -53,8 +53,8 @@ export class RPCServer<
|
53
|
53
|
if(conf.connectionHandler) conf.connectionHandler(socket)
|
54
|
54
|
}
|
55
|
55
|
|
56
|
|
- let badRPC
|
57
|
|
- if(badRPC = exporters.flatMap(ex => ex.exportRPCs()).find(rpc => !rpc.name))
|
|
56
|
+ let badRPC = exporters.flatMap(ex => ex.exportRPCs()).find(rpc => !rpc.name)
|
|
57
|
+ if(badRPC)
|
58
|
58
|
throw new Error(`
|
59
|
59
|
RPC did not provide a name.
|
60
|
60
|
\nUse 'funtion name(..){ .. }' syntax instead.
|
|
@@ -69,14 +69,14 @@ export class RPCServer<
|
69
|
69
|
try{
|
70
|
70
|
this.io.attach(this.ws)
|
71
|
71
|
this.io.on('socket', (socket:I.Socket) => {
|
72
|
|
- socket.on('error', (err) => this.errorHandler(socket, err, "bind", []))
|
|
72
|
+ socket.on('error', (err) => this.errorHandler(socket, err, "system", []))
|
73
|
73
|
socket.on('close', () => this.closeHandler(socket))
|
74
|
74
|
this.connectionHandler(socket)
|
75
|
75
|
this.initRPCs(socket)
|
76
|
76
|
})
|
77
|
77
|
this.ws.listen(this.port, this.visibility)
|
78
|
78
|
}catch(e){
|
79
|
|
- this.errorHandler(this.io, e, 'start', [])
|
|
79
|
+ this.errorHandler(this.io, e, 'system', [])
|
80
|
80
|
}
|
81
|
81
|
}
|
82
|
82
|
|
|
@@ -87,7 +87,7 @@ export class RPCServer<
|
87
|
87
|
]
|
88
|
88
|
}
|
89
|
89
|
|
90
|
|
- async destroy(): Promise<void> {
|
|
90
|
+ destroy(): void {
|
91
|
91
|
this.io.close()
|
92
|
92
|
this.ws.close()
|
93
|
93
|
}
|