Checks whether the specified rule exists in the collection of added rules. If the rule is of the thread level, this operation is performed only on the current thread.
...
...
@@ -113,7 +113,7 @@ Checks whether the specified rule exists in the collection of added rules. If th
| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.|
| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the device can reply to the SMS message through the originating SMSC.|
| isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.|
| isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.|
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
>Newly added APIs are defined but not implemented in OpenHarmony 3.1 Release. They will be available for use in OpenHarmony 3.1 MR.
You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the [createWebSocket](#websocketcreatewebsocket) API to create a [WebSocket](#websocket) object and then use the [connect](#connect) API to connect to the server. If the connection is successful, the client will receive a callback of the [open](#onopen) event. Then, the client can communicate with the server using the [send](#send) API. When the server sends a message to the client, the client will receive a callback of the [message](#onmessage) event. If the client no longer needs this connection, it can call the [close](#close) API to disconnect from the server. Then, the client will receive a callback of the [close](#onclose) event.
...
...
@@ -12,13 +11,13 @@ If an error occurs in any of the preceding processes, the client will receive a
## Modules to Import
```
```js
importwebSocketfrom'@ohos.net.webSocket';
```
## Complete Example
```
```js
importwebSocketfrom'@ohos.net.webSocket';
vardefaultIpAddress="ws://";
...
...
@@ -78,7 +77,7 @@ Creates a WebSocket connection. You can use this API to create or close a WebSoc
**Example**
```
```js
letws=webSocket.createWebSocket();
```
...
...
@@ -107,7 +106,7 @@ Initiates a WebSocket request to establish a WebSocket connection to a given URL
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.connect(url,(err,value)=>{
...
...
@@ -141,7 +140,7 @@ Initiates a WebSocket request carrying specified options to establish a WebSocke
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.connect(url,{
...
...
@@ -184,7 +183,7 @@ Initiates a WebSocket request carrying specified options to establish a WebSocke
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
letpromise=ws.connect(url);
...
...
@@ -215,7 +214,7 @@ Sends data through a WebSocket connection. This API uses an asynchronous callbac
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.connect(url,(err,value)=>{
...
...
@@ -254,7 +253,7 @@ Sends data through a WebSocket connection. This API uses a promise to return the
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.connect(url,(err,value)=>{
...
...
@@ -286,7 +285,7 @@ Closes a WebSocket connection. This API uses an asynchronous callback to return
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.close((err,value)=>{
...
...
@@ -318,7 +317,7 @@ Closes a WebSocket connection carrying specified options such as **code** and **
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
ws.close({
...
...
@@ -358,7 +357,7 @@ Closes a WebSocket connection carrying specified options such as **code** and **
**Example**
```
```js
letws=webSocket.createWebSocket();
leturl="ws://"
letpromise=ws.close({
...
...
@@ -391,7 +390,7 @@ Enables listening for the **open** events of a WebSocket connection. This API us