提交 ea10dce2 编写于 作者: X xujie

Fix review issue

Change-Id: Iad7f353a3a7f18378810c6e291d5721e58e0e16d
Signed-off-by: Nxujie <xujie223@huawei.com>
上级 8ac74376
......@@ -49,7 +49,7 @@ let VpnConnection = vpn.createVpnConnection(globalThis.context)
@Entry
@Component
struct Index {
@State message: string = 'Toy VPN'
@State message: string = 'Test VPN'
CreateTunnel() {
TunnelFd = vpn_client.tcpConnect("192.168.43.208", 8888)
......
......@@ -174,8 +174,8 @@ setUp(config: VpnConfig): Promise\<number\>;
dnsAddresses:[
"114.114.114.114"
],
acceptedApplications:[],
refusedApplications:[]
trustedApplications:[],
blockedApplications:[]
}
VpnConnection.setUp(config).then((data) => {
console.info(TAG + "setUp success, tunfd: " + JSON.stringify(data))
......@@ -236,9 +236,8 @@ protect(socketFd: number, callback: AsyncCallback\<void\>): void;
})
tcp.getSocketFd().then((tunnelfd) => {
console.info("tunenlfd: " + tunnelfd);
VpnConnection.protect(tunnelfd, (error, data) => {
VpnConnection.protect(tunnelfd, (error) => {
console.info(JSON.stringify(error));
console.info(JSON.stringify(data));
})
})
```
......@@ -300,8 +299,8 @@ protect(socketFd: number): Promise\<void\>;
})
tcp.getSocketFd().then((tunnelfd) => {
console.info("tunenlfd: " + tunnelfd);
VpnConnection.protect(tunnelfd).then((data) => {
console.info("protect success" + JSON.stringify(data))
VpnConnection.protect(tunnelfd).then(() => {
console.info("protect success.")
}).catch(err => {
console.info("protect fail" + JSON.stringify(err))
})
......@@ -341,9 +340,8 @@ destroy(callback: AsyncCallback\<void\>): void;
**示例:**
```js
VpnConnection.destroy((error, data) => {
VpnConnection.destroy((error) => {
console.info(JSON.stringify(error));
console.info(JSON.stringify(data));
})
```
......@@ -373,15 +371,14 @@ destroy(): Promise\<void\>;
| ------- | ----------------------------- |
| 201 | Permission denied. |
| 202 | Non-system applications use system APIs. |
| 401 | Parameter error. |
| 2200002 | Operation failed. Cannot connect to service. |
| 2100003 | System internal error. |
**示例:**
```js
VpnConnection.destroy().then((data) => {
console.info("destroy success" + JSON.stringify(data))
VpnConnection.destroy().then(() => {
console.info("destroy success.")
}).catch(err => {
console.info("destroy fail" + JSON.stringify(err))
});
......
......@@ -31,7 +31,7 @@ VPN exist already, please execute destroy first.
**错误描述**
VPN已经存在,请先执行destory接口
VPN连接已存在,请先调用destroy接口销毁VPN连接
**可能原因**
......@@ -58,4 +58,4 @@ tcp链路建立失败。
**处理步骤**
检查tcp链路是否建立成功。
\ No newline at end of file
检查socket链路是否建立成功。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册