如何实现后端推送数据?
#3339
-
我参考官网,使用了如下方式: @Injectable()
export class TodoNodeService extends RPCService implements ITodoNodeService {
showMessage = (message: string) => {
// 这里的 this.rpcClient![0] 可以直接获取到通信通道下的 proxy 实例
this.rpcClient![0].onMessage(`I got you message, echo again. ${message}`);
};
} 这样往browser端推送数据,但browser端接收不到,不知道这样写正确吗 |
Beta Was this translation helpful? Give feedback.
Answered by
bytemain
Feb 5, 2024
Replies: 1 comment 1 reply
-
通信的例子是运行良好的,可以参考:https://github.com/opensumi/opensumi-module-samples/blob/main/modules/connection/browser/index.ts#L21 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hanbingzi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
通信的例子是运行良好的,可以参考:https://github.com/opensumi/opensumi-module-samples/blob/main/modules/connection/browser/index.ts#L21
请检查一下 browser 层的 Module 中是否声明了相应的 clientToken: