Compare commits
2 Commits
0aa1bc102b
...
af71702840
Author | SHA1 | Date | |
---|---|---|---|
|
af71702840 | ||
|
461713baba |
4
lib/app/JlGraphicApp.d.ts
vendored
4
lib/app/JlGraphicApp.d.ts
vendored
@ -358,7 +358,7 @@ export interface IGraphicScene extends EventEmitter<GraphicAppEvents> {
|
||||
/**
|
||||
* 发布websocket消息
|
||||
*/
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
}
|
||||
declare abstract class GraphicSceneBase extends EventEmitter<GraphicAppEvents> implements IGraphicScene {
|
||||
private graphicStore;
|
||||
@ -496,7 +496,7 @@ declare abstract class GraphicSceneBase extends EventEmitter<GraphicAppEvents> i
|
||||
/**
|
||||
* 发布websocket消息
|
||||
*/
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
/**
|
||||
* 处理图形状态
|
||||
* @param graphicStates
|
||||
|
4
lib/message/BasicMessageClient.d.ts
vendored
4
lib/message/BasicMessageClient.d.ts
vendored
@ -33,7 +33,7 @@ export declare abstract class MessageClient extends EventEmitter<MessageClientEv
|
||||
getOrNewSubClient(destination: string): SubscriptionClient;
|
||||
addSubscription(destination: string, handler: IMessageHandler): void;
|
||||
removeSubscription(destination: string, handle: IMessageHandler): void;
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
abstract get connected(): boolean;
|
||||
abstract close(): void;
|
||||
}
|
||||
@ -48,7 +48,7 @@ export declare class SubscriptionClient {
|
||||
removeHandler(handler: IMessageHandler): void;
|
||||
trySubscribe(): void;
|
||||
unsubscribe(): void;
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
handleMessage(data: any): void;
|
||||
onDisconnect(): void;
|
||||
}
|
||||
|
6
lib/message/MessageBroker.d.ts
vendored
6
lib/message/MessageBroker.d.ts
vendored
@ -69,7 +69,7 @@ export interface IMessageClient extends EventEmitter<MessageClientEvents> {
|
||||
* @param destination
|
||||
* @param message
|
||||
*/
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
/**
|
||||
* 是否已经连接
|
||||
*/
|
||||
@ -90,7 +90,7 @@ export declare class WsMsgCli {
|
||||
static registerSubscription(destination: string, handler: IMessageHandler): void;
|
||||
static unregisterSubscription(destination: string, handler: IMessageHandler): void;
|
||||
static registerAppMsgBroker(broker: AppWsMsgBroker): void;
|
||||
static publishMessage(destination: string, message: string): void;
|
||||
static publishMessage(destination: string, message: Uint8Array): void;
|
||||
static removeAppMsgBroker(broker: AppWsMsgBroker): void;
|
||||
static hasAppMsgBroker(): boolean;
|
||||
/**
|
||||
@ -145,7 +145,7 @@ export declare class AppWsMsgBroker {
|
||||
unsbuscribe(destination: string): void;
|
||||
unsubscribeAll(): void;
|
||||
resubscribeAll(): void;
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
/**
|
||||
* 取消所有订阅,从通用Stomp客户端移除此消息代理
|
||||
*/
|
||||
|
2
lib/message/MqttBroker.d.ts
vendored
2
lib/message/MqttBroker.d.ts
vendored
@ -10,5 +10,5 @@ export declare class MqttMsgClient extends MessageClient {
|
||||
unsubscribe0(destination: string): void;
|
||||
get connected(): boolean;
|
||||
close(): void;
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
}
|
||||
|
2
lib/message/WsMsgBroker.d.ts
vendored
2
lib/message/WsMsgBroker.d.ts
vendored
@ -7,6 +7,6 @@ export declare class StompMessagingClient extends MessageClient {
|
||||
get connected(): boolean;
|
||||
subscribe(destination: string, handle: HandleMessage): boolean;
|
||||
unsubscribe0(destination: string): void;
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
close(): void;
|
||||
}
|
||||
|
@ -615,7 +615,7 @@ export interface IGraphicScene extends EventEmitter<GraphicAppEvents> {
|
||||
/**
|
||||
* 发布websocket消息
|
||||
*/
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
}
|
||||
|
||||
abstract class GraphicSceneBase
|
||||
@ -1165,7 +1165,7 @@ abstract class GraphicSceneBase
|
||||
/**
|
||||
* 发布websocket消息
|
||||
*/
|
||||
publishMessage(destination: string, message: string) {
|
||||
publishMessage(destination: string, message: Uint8Array) {
|
||||
this.checkWsMsgCli();
|
||||
this.wsMsgBroker.publishMessage(destination, message);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ export abstract class MessageClient
|
||||
this.getOrNewSubClient(destination).removeHandler(handle);
|
||||
}
|
||||
|
||||
publishMessage(destination: string, message: string): void {
|
||||
publishMessage(destination: string, message: Uint8Array): void {
|
||||
const cli = this.getOrNewSubClient(destination);
|
||||
cli.publishMessage(destination, message);
|
||||
}
|
||||
@ -130,7 +130,7 @@ export class SubscriptionClient {
|
||||
this.mc.unsubscribe(this.destination);
|
||||
}
|
||||
|
||||
publishMessage(destination: string, message: string): void {
|
||||
publishMessage(destination: string, message: Uint8Array): void {
|
||||
if (this.mc.connected) {
|
||||
this.mc.publishMessage(destination, message);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ export interface IMessageClient extends EventEmitter<MessageClientEvents> {
|
||||
* @param destination
|
||||
* @param message
|
||||
*/
|
||||
publishMessage(destination: string, message: string): void;
|
||||
publishMessage(destination: string, message: Uint8Array): void;
|
||||
/**
|
||||
* 是否已经连接
|
||||
*/
|
||||
@ -168,7 +168,7 @@ export class WsMsgCli {
|
||||
WsMsgCli.appMsgBroker.push(broker);
|
||||
}
|
||||
|
||||
static publishMessage(destination: string, message: string) {
|
||||
static publishMessage(destination: string, message: Uint8Array) {
|
||||
WsMsgCli.client.publishMessage(destination, message);
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ export class AppWsMsgBroker {
|
||||
});
|
||||
}
|
||||
|
||||
publishMessage(destination: string, message: string) {
|
||||
publishMessage(destination: string, message: Uint8Array) {
|
||||
WsMsgCli.publishMessage(destination, message);
|
||||
}
|
||||
|
||||
|
@ -112,10 +112,10 @@ export class MqttMsgClient extends MessageClient {
|
||||
console.warn('MQTT 消息客户端关闭失败', error);
|
||||
}
|
||||
}
|
||||
publishMessage(destination: string, message: string): void {
|
||||
publishMessage(destination: string, message: Uint8Array): void {
|
||||
console.debug('MQTT发布消息');
|
||||
if(this.connected) {
|
||||
this.cli.publish(destination, message);
|
||||
this.cli.publish(destination, message as Buffer);
|
||||
}else {
|
||||
console.warn('MQTT 未连接,消息发布失败');
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export class StompMessagingClient extends MessageClient {
|
||||
this.cli.unsubscribe(destination);
|
||||
}
|
||||
|
||||
publishMessage(destination: string, message: string): void {
|
||||
publishMessage(destination: string, message: Uint8Array): void {
|
||||
console.debug('MQTT发布消息:未实现');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user