fix: websocket session send synchronized
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
5943d6882f
commit
c9ca4ffd39
@ -36,7 +36,7 @@ export class TomcatClient extends EventEmitter implements SocketIO.EngineSocket
|
|||||||
return this._id;
|
return this._id;
|
||||||
}
|
}
|
||||||
send(text: string) {
|
send(text: string) {
|
||||||
this.session.getBasicRemote().sendText(text)
|
Java.synchronized(() => this.session.getBasicRemote().sendText(text), this.session)()
|
||||||
}
|
}
|
||||||
close() {
|
close() {
|
||||||
this.session.close();
|
this.session.close();
|
||||||
|
@ -6,7 +6,7 @@ import { SocketIO } from '../socket-io/interfaces'
|
|||||||
import { ProxyBeanName } from './constants'
|
import { ProxyBeanName } from './constants'
|
||||||
import { TomcatClient } from './client'
|
import { TomcatClient } from './client'
|
||||||
|
|
||||||
const WebSocketServerProxy = Java.type("com.sixi.framework.scriptservice.websocket.WebSocketServerProxy")
|
const WebSocketServerProxy = Java.type("pw.yumc.MiaoScript.websocket.WebSocketProxy")
|
||||||
const ThreadPoolExecutor = Java.type('java.util.concurrent.ThreadPoolExecutor')
|
const ThreadPoolExecutor = Java.type('java.util.concurrent.ThreadPoolExecutor')
|
||||||
const ThreadPoolTaskExecutor = Java.type('org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor')
|
const ThreadPoolTaskExecutor = Java.type('org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user