未验证 提交 10b98eed 编写于 作者: O openharmony_ci 提交者: Gitee

!4851 Rpc doc bugfix

Merge pull request !4851 from pilipala195/master
...@@ -81,11 +81,6 @@ writeRemoteObject(object: [IRemoteObject](#iremoteobject)): boolean ...@@ -81,11 +81,6 @@ writeRemoteObject(object: [IRemoteObject](#iremoteobject)): boolean
console.log("server is died"); console.log("server is died");
} }
} }
class MyDeathRecipient {
onRemoteDied() {
console.log("server is died");
}
}
class TestRemoteObject extends rpc.RemoteObject { class TestRemoteObject extends rpc.RemoteObject {
constructor(descriptor) { constructor(descriptor) {
super(descriptor); super(descriptor);
...@@ -127,11 +122,6 @@ readRemoteObject(): IRemoteObject ...@@ -127,11 +122,6 @@ readRemoteObject(): IRemoteObject
console.log("server is died"); console.log("server is died");
} }
} }
class MyDeathRecipient {
onRemoteDied() {
console.log("server is died");
}
}
class TestRemoteObject extends rpc.RemoteObject { class TestRemoteObject extends rpc.RemoteObject {
constructor(descriptor) { constructor(descriptor) {
super(descriptor); super(descriptor);
...@@ -1613,7 +1603,7 @@ readCharArray(): number[] ...@@ -1613,7 +1603,7 @@ readCharArray(): number[]
``` ```
let data = rpc.MessageParcel.create(); let data = rpc.MessageParcel.create();
let result = data.writeCharArray(['a', 'b', 'c']); let result = data.writeCharArray([97, 98, 99]);
console.log("RpcClient: writeCharArray is " + result); console.log("RpcClient: writeCharArray is " + result);
let array = data.readCharArray(); let array = data.readCharArray();
console.log("RpcClient: readCharArray is " + array); console.log("RpcClient: readCharArray is " + array);
...@@ -3530,7 +3520,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options ...@@ -3530,7 +3520,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
let reply = rpc.MessageParcel.create(); let reply = rpc.MessageParcel.create();
data.writeInt(1); data.writeInt(1);
data.writeString("hello"); data.writeString("hello");
let ret: boolean = proxy.sendRequest(1, data, reply, option); let ret: boolean = testRemoteObject.sendRequest(1, data, reply, option);
if (ret) { if (ret) {
console.log("sendRequest got result"); console.log("sendRequest got result");
let msg = reply.readString(); let msg = reply.readString();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册